3 Questions for you to see how well do you know JavaScript
Here are 3 question to examine your JavaScript knowledge.
Please try to answer before you run and execute the code.
After you see the result, try to understand why.
1. ??
function getLowercase()
{
const UNDEFINED = ['U', 'N', 'D', 'E', 'F', 'I', 'N', 'E', 'D'];
return
{
UNDEFINED;
}
}
//What will be the result? why?
console.log('Lower case:', getLowercase())
2.??
const arr = [1, 0, 10, 21];
//What will be the result? why?
console.log(arr.map(parseInt));
3.???♂?
const PIE = 3.14;
const object1 = { pie: PIE };
const object2 = { pie: PIE };
//What will be the result? why?
console.log(object1 === object2);
//That would be different? why?
console.log(object1 == object2);
You're welcome to share your answers, thoughts and more cool things ??
Thanks,
Ziv Ben-Or
+972545882011
Senior Full Stack Developer (Vue.js, C#) @Isracard | ?? JavaScript
5 年{ pie: 3.14 } === { pie: 3.14 }? => false Do you know why?
Senior Full Stack Developer (Vue.js, C#) @Isracard | ?? JavaScript
5 年[1, 0, 10, 21].map(parseInt)? =>?[1, NaN, 2, 7]. Do you know why?
Senior Full Stack Developer (Vue.js, C#) @Isracard | ?? JavaScript
5 年Do you know why?