JavaScript Coding Exercises For Beginners: Beginner Exercises Part 4

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

Here's another set of JavaScript exercises to practice your problem solving skills.

Рекомендации по теме
Комментарии
Автор

I managed part 1-3 just fine but wow, I struggled today with this…
Awesome video! It’s nice to get so much practice.

emmadahl
Автор

I am on 4th part of your this series and i found it extremely effective to enhance my reach in java script
###💻💻💻 from india###

piyushthakur
Автор

Great respect! I have been hanging around for weeks and I could not go a little further with knowing JS. Thanks to your films, I felt I was going further. Thanks a lot!

sewixwro
Автор

These are so incredibly helpful, so thank you for your time dude.

zedsmelee
Автор

Love this series!

Slight correction: Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100, but these centurial years are leap years if they are exactly divisible by 400. For example, the years 1700, 1800, and 1900 are not leap years, but the years 1600 and 2000 are.

Should be:
year % 4 === 0
? (year % 100 === 0
? (year % 400 === 0
? true : false)
: true)
: false;

yonycto
Автор

That "every" function is gonna come in really handy, didn't know about it. My solution was:
```
const compare = (a, b) => {
for(key in a) if(b[key]===undefined) return false;
return true
}
```
This tutorials are super helpful

davidsaso
Автор

Gotta say - this is kind of what all the udemy courses are missing. Tons of practice exercises to cement the language fundamentals. If this was a udemy course(teaching the language from the ground up using these types of exercises) it would be hugely successful.

omergronich
Автор

5 years later and I still think these videos are so relevant for junior devs.

Here is my solution for #2:

const func = (obj1, obj2) => {
let result;
Object.keys(obj2).map((key) =>
? (result = false) : (result = true)
);
return result;
};

joeyreyes
Автор

Great content man!really appreciate your channel. From South Africa🇿🇦

thabisomakolana
Автор

Thanks for the exercises, it's really helpful 😁

pavithrar
Автор

Exc5:

const isEveryElm = (ages) => ages.every(age => age >= 15)

console.log(isEveryElm([15, 33, 16, 40]))

myshuker
Автор

Please could you continue to make this series, as they are excellent and I'm having a lot of fun going through them. I really think, they are very helpful for anyone learning JavaScript.

RedEyedJedi
Автор

task 5: get minimum of array, return min > x;

RAZUMOVSKY
Автор

convert the PDF challenges into a UDEMY COURSE! nice series

alexdeclercq
Автор

i have done it by making a object where number 1 to 16 are keys and the hexadecimal character for each number is the value.

parthdeshwal
Автор

function same(obj1, obj2){

let property=Object.keys(obj1)
for (let i = 0; i < property.length; i++) {

return false
}

}
return true

}

dace
Автор

Formula for a leap year.
The year can be evenly divided by 4.
If the year can be evenly divided by 100, it is NOT a leap year, unless; The year is also evenly divisible by 400. Then it is a leap year.

RedEyedJedi
Автор

const predicateFunc = statment => statment.map(x => x >= 0);
var preFun = predicateFunc([3, 5, 6, 7, 5, 5, 6]);
const trueOrFalse = preFun => preFun.filter(x => x === true).length === preFun.length;

saifeddine
Автор

Here's my lengthy solution to Exercise 3:

function csvTo2D(string) {
let csv = string.split(', ')
let len = csv.length
let counter = 0
for (let char of csv) {
let splitted = char.split('')
csv[counter] = splitted
counter++;
}
return csv
}

console.log(csvTo2D('abc, def, ghi'))

It's not formatted correctly, but I did the exact same thing codebubb did.

purplexionroblox
Автор

For exercise 5 I wrote this:
function isAllTrue(arr) {
const str1 = arr.join('');
const str2 = arr.filter(x => x<5).join('');
if (str1 === str2) {
return true;
} else {
return false;
}
};
const array1 = [1, 2, 3, 4];


What I learned in this exercise is that two arrays, functions or objects with same content does not return true when compared. e.g:
[1, 2, 3, 4] === [1, 2, 3, 4] // returns false
you have to join them or convert them to string. e.g:
[1, 2, 3, 4].join('') === [1, 2, 3, 4].join('') // returns true because 1234 === 1234 returns true

bibekgurung