CHALLENGE β
let x = 5;
let result = typeof (x + "10");
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
π4β€3
β€22π9π€9π€©2 1
Zach Wilson
Please open Telegram to view this post
VIEW IN TELEGRAM
π€£87 5π€3π€©2
function foo() {
let a = b = 0
a++
return a
}
foo()
console.log(typeof a)
console.log(typeof b)
Please open Telegram to view this post
VIEW IN TELEGRAM
π€22π8β€2
What is the output?
Anonymous Quiz
21%
undefined, number
27%
undefined, undefined
39%
number, number
13%
number undefined
π24 7β€2π€2
const obj = {
a: 1,
b: function() {
console.log(this.a);
}
};
const func = obj.b;
func();
Please open Telegram to view this post
VIEW IN TELEGRAM
β€10π6 1
What is the output?
Anonymous Quiz
52%
1
26%
undefined
14%
TypeError: Cannot read property 'a' of undefined
7%
ReferenceError: a is not defined
π€33π15 10β€1π€©1
Please open Telegram to view this post
VIEW IN TELEGRAM
π€£98π€17β€6 3
function* generator() {
yield 1;
yield 2;
yield 3;
}
const gen = generator();
console.log(gen.next().value);
console.log(gen.next().value);
Please open Telegram to view this post
VIEW IN TELEGRAM
π3β€2
π€22π12β€7 4
In an ES module, instead of using __dirname or __filename, you can now use import.iss.oneta.dirname and import.iss.oneta.filename (this came with Node 20.11.0 (LTS) released in January).
PHIL NASH
Please open Telegram to view this post
VIEW IN TELEGRAM
π9 4β€2
const a = { a: 1 };
const b = Object.assign({}, a);
b.a = 2;
console.log(a.a);
Please open Telegram to view this post
VIEW IN TELEGRAM
What is the output?
Anonymous Quiz
28%
2
44%
1
15%
undefined
13%
TypeError: Cannot set property 'a' of undefined
π€£20π€13π11β€7 7
const a = [1, 2, 3];
const b = a.slice(0, 2).push(4);
console.log(b);
Please open Telegram to view this post
VIEW IN TELEGRAM
π2
π€70π€£25π16β€5 1
A helpful diagrammed and animated article, coupled with an (optional) 8-minute video, that goes into how promises work and are scheduled behind the scenes. Itβs useful to have a good mental model of these mechanics, given promises form the basis of asynchronous functions in JavaScript.
LYDIA HALLIE
Please open Telegram to view this post
VIEW IN TELEGRAM
π12 5β€4π€1
const a = [1, 2, 3];
const b = a.flatMap(x => [x, x * 2]);
console.log(b);
Please open Telegram to view this post
VIEW IN TELEGRAM
π9β€1
What is the output?
Anonymous Quiz
25%
[1, 2, 3, 2, 4, 6]
41%
[1, 2, 2, 4, 3, 6]
28%
[2, 4, 6]
6%
[1, 2, 3]
π€©15β€8π4
Wow check this out fully typed Vue components π²
Features
- Dark mode support
- Keyboard shortcuts
- Icons
...
ManukMinasyan
Features
- Dark mode support
- Keyboard shortcuts
- Icons
...
ManukMinasyan
Please open Telegram to view this post
VIEW IN TELEGRAM
β€5π2 2