Please open Telegram to view this post
VIEW IN TELEGRAM
π€£73π4π€3β€1
CHALLENGE
let obj = { a: 1 };
let proto = { b: 2 };
Object.setPrototypeOf(obj, proto);
for (let key in obj) {
console.log(key);
}
π3π€2
π₯13π9π€5β€4
A less significant release, feature-wise, than 22.0 or 22.1, but lots of little bug fixes, tweaks around core dev experience, getting Nodeβs built-in ESLint rules ready for ESLint v9, and the Υ--inspect-waitΥ flag to make the debugger wait for a connection in order to debug code from the very start of execution.
MICHAΓL ZASSO
Please open Telegram to view this post
VIEW IN TELEGRAM
π6β€4π₯2π€©2
CHALLENGE
let obj = { a: 1 };
Object.freeze(obj);
console.log(Object.isFrozen(obj));
console.log(obj.a = 2);
console.log(obj.a);
β€5π₯5π1π€1
π€19π6β€3π₯2
CHALLENGE
let obj = {};
Object.defineProperty(obj, 'a', {
value: 1,
enumerable: true
});
let clone = Object.create(
Object.getPrototypeOf(obj),
Object.getOwnPropertyDescriptors(obj)
);
console.log(clone.a);
console.log(clone.hasOwnProperty('a'));
π12β€3π₯3
What is the output?
Anonymous Quiz
16%
undefined, false
55%
1, true
18%
1, false
10%
undefined, true
π11β€3π₯2
QUICK BITS:
π€ It hasn't been finalized yet, but the Node team is working on a Node.js Advocacy Ambassador program where the team will nominate a group of annual ambassadors to help in spreading the word about various Node.js topics.
β οΈ If you haven't taken the official Node.js Next 10 Survey yet, please do! Entries close this Friday, May 24, and your input will help steer future core team decisions.
βΌοΈ Talking of surveys, the 2024 Stack Overflow developer survey has just gone live. It's open till June 7.
Please open Telegram to view this post
VIEW IN TELEGRAM
π5β€2π₯2
CHALLENGE
let proto = { a: 1 };
let obj = Object.create(proto);
Object.defineProperty(obj, 'a', {
value: 2,
writable: false,
enumerable: true,
configurable: false
});
console.log(obj.a);
proto.a = 3;
console.log(obj.a);
π₯7
π15π€9β€5π€©4π₯3
CHALLENGE
console.log(1);
setTimeout(() => {
console.log(2);
}, 100);
setTimeout(() => {
console.log(3);
}, 0);
Promise.resolve().then(() => {
console.log(4);
}).then(() => {
console.log(5);
});
console.log(6);
π8β€3
What is the output?
Anonymous Quiz
14%
1, 6, 4, 3, 5, 2
33%
1, 6, 3, 4, 5, 2
16%
1, 6, 4, 5, 2, 3
37%
1, 6, 4, 5, 3, 2
β€11π€5π€©4π3π₯3
CHALLENGE
const obj = {
a: 1,
b: function() {
return () => {
return this.a;
};
},
c: function() {
return function() {
return this.a;
};
}
};
const arrowFunc = obj.b();
const regularFunc = obj.c();
console.log(arrowFunc());
console.log(regularFunc());
π9π€6
What is the output?
Anonymous Quiz
19%
undefined, 1
24%
undefined, undefined
37%
1, 1
20%
1, undefined
β€17π€13π5π€£3π₯1
Frank has a great reputation for putting together stunning visual demos with the tiniest amounts of JavaScript. This is no exception. He goes into a lot of detail about how it works; youβll learn a few things and/or come away awe-struck.
FRANK FORCE
Please open Telegram to view this post
VIEW IN TELEGRAM
π3β€2π₯2π€©2
CHALLENGE
function* generator() {
yield* [1, 2, 3];
yield 4;
}
const gen = generator();
console.log([...gen]);
β€1π1π€£1
π€©9π€£8π₯5π3β€1π€1