JavaScript
32K subscribers
1.04K photos
10 videos
33 files
718 links
A resourceful newsletter featuring the latest and most important news, articles, books and updates in the world of #javascript 🚀 Don't miss our Quizzes!

Let's chat: @nairihar
Download Telegram
CHALLENGE


const obj = {
valueOf() {
return 42;
}
};

const result = obj + 8;
console.log(result);
👍113🤣3
What is the output?
Anonymous Quiz
21%
object Object8
11%
42
53%
50
15%
undefined
🤩22👍107
CHALLENGE

function trickyFunction() {
var a = 10;
var b = a;
b = 15;

const obj1 = { x: 1 };
const obj2 = obj1;
obj2.x = 5;

console.log(a + ' ' + b + ' ' + obj1.x);
}

trickyFunction();
🤣10🤔9👍7
What is the output?
Anonymous Quiz
30%
10 15 1
22%
15 15 5
41%
10 15 5
7%
10 10 1
👍34🤣19🤔11🔥2🤩1
🌦 awesome-nest-schematics

Awesome Nest Boilerplate architecture element generation based on Angular schematics 🎬

NarHakobyan
Please open Telegram to view this post
VIEW IN TELEGRAM
👍9🔥53
CHALLENGE

function trickyFunction() {
var x = 10;
if (x > 5) {
let y = x * 2;
x = y;
}
return x;
}

console.log(trickyFunction());
👍115
What is the output?
Anonymous Quiz
67%
20
10%
undefined
20%
10
3%
ReferenceError
👍31🤣202🤔1
🌦 awesome-nest-boilerplate

This is an ever-evolving, very opinionated architecture and dev environment for new node projects using NestJS.

NarHakobyan
Please open Telegram to view this post
VIEW IN TELEGRAM
👍93🔥1
CHALLENGE

function trickyFunction() {
var obj = { a: 1 };
var anotherObj = obj;
obj.a = 2;
obj = { a: 3 };
anotherObj.a = 4;
return obj.a + anotherObj.a;
}

console.log(trickyFunction());
12🤔6👍2
What is the output?
Anonymous Quiz
21%
6
43%
7
31%
8
6%
5
🔥27👍95🤔2
Please open Telegram to view this post
VIEW IN TELEGRAM
👍8🔥31
CHALLENGE

async function fetchData() {
let data = 'initial';

const promise = new Promise((resolve) => {
setTimeout(() => {
resolve('fetched');
}, 1000);
});

promise.then((result) => {
data = result;
});

return data;
}

fetchData().then(console.log);
👍132
🤔16👍14🤣112🔥2
😢
Please open Telegram to view this post
VIEW IN TELEGRAM
🤣75🤔13🤩2
CHALLENGE

const WM = new WeakMap();
let obj = {};
let anotherObj = {};
WM.set(obj, 'object data');
WM.set(anotherObj, 'another object data');
obj = null;

// Let's check what's logged
console.log(WM.has(obj));
console.log(WM.has(anotherObj));
👍91
7👍6🔥4
CHALLENGE

const mySet = new Set();
mySet.add(10);
mySet.add(20);
mySet.add(10);
mySet.add(30);

console.log(mySet.size);
👍13
What is the output?
Anonymous Quiz
44%
3
44%
4
6%
2
6%
1
🤔29🤣22👍1510🤩1
CHALLENGE

function* customGenerator() {
yield 'Hello';
yield 'World';
return 'Done';
}

const gen = customGenerator();
console.log(gen.next().value);
console.log(gen.next().value);
console.log(gen.next().value);
👍71