JavaScript Practice Exercises For Beginners: Beginner Exercises Part 1

preview_player
Показать описание

It's important to practice your JavaScript coding skills but it can be tricky to find decent problems to solve and then you're always left wondering - is there a different or better way of solving the problem?

In these JavaScript practice exercises, you'll get the chance to be given a problem, have a go at solving it and then run through a possible solution to check your own.

JavaScript for beginners can be a bit of a stab in the dark to know whether your code is correct and the truth is that, for most javascript problems, there isn't a right or wrong way of doing it.

But for some JavaScript practice problems, there is usually a short solution which can be achieved with JavaScript function and that is generally the aim of these JavaScript practice exercises for beginners.

It can also be good for you to see someone else break down a problem and code it in JavaScript and compare it with your own approach to a problem. Channel Handle @codewithbubb
Рекомендации по теме
Комментарии
Автор

man learned so much from those examples i'll be forever in your debt
thanks for the knowledge

creponnekarim
Автор

Can't figure out y this channel still not getting the number of subscribers it deserves

ajitesh
Автор

In exercise 2 I used "const fun = (str) => str.split('.').pop();" its shorter and wont print a dot in outcome :)

pawelblicharz
Автор

we can either do by this way:

function sum(a, b){
if(a + b == 100){
console.log(true)
}else{
console.log(false)
}

}

sum(100, 0)

TheComputerPitch
Автор

ex3: more dynamic

function charFollowing(stg) {
let newStg = "";
for (let i = 0; i < stg.length; i++) {
const letter = stg[i];

newStg = newStg + + 1);
}

return newStg;
}

dace
Автор

On the last exercise, I used the startsWith method which seems to be slightly more concise than using indexOf. It takes the string you want to search for as the first argument and the position you want to start with. And it will return a boolean depending on what it finds. Just an alternative method you can use.

calibribody
Автор

I'm failing miserably but thanks for doing these

chubbyBunny
Автор

me : solving problem with 5 code lines "thinks its the best solution"
Junior: solving the same problem with 1 line of code
me : :(

mustafasalih
Автор

An invaluable resource for learning Javascript! Thank you!

Elator
Автор

I really really LOVE this video, please keep on making these :)

andylib
Автор

This is immensely helpful. I see a lot of tutorials for beginners using outdated notation, but I feel it is really important to get used to ES6 right from the initial stage.
One question: wouldn't it be enough to declare the function without the "const" before the function name?

zalodias
Автор

I really enjoyed this. challenge 1) let value1 = Number(prompt("Enter a value:"));
let value2 = Number(prompt("Enter another value:"));

if (value1 === 100 || value2 === 100 || value1 + value2 === 100) {
alert("True");
}

channelname
Автор

Great video! On the third exercise I also made sure that str was a string. What do you think?
const moveCharsForward = str => {
str = str.toString();
str = str
.split("")
.map(char => + 1))
.join("");
return str;
};
//output 32

eltonstalspets
Автор

My attempt for the first exercise:
var a;
var b;
function result(a, b) {
if (a==100||b==100 || (a+b)==100) {
return true;
} else {
return false;
}
}
console.log(result(20, 50));

elilopez_
Автор

6:22 -- 3rd exercise Gets me every time.

renanalves
Автор

This is helpful, I hope in the future you will add a level of difficulty to these challenges. Thank you so much

bryandelacruz
Автор

Thank you for the exercises. Ashame to say, i fail completely...but, will not give up. More JS please..., 👍👍🙏🙏🖐️🖐️

oukiebotha
Автор

7:11 map doesn’t mutate an array but instead creates a new one.

scottv
Автор

i wrote a 14 line code with an added feature taking input from user console.log("LOVE THE VIDEO");

wrench
Автор

Thanks a lot i was searching for this type of video finally i got you well, hope you make video on shapes in javaScript

worldaroundus