JavaScript
32K subscribers
1.04K photos
10 videos
33 files
720 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
πŸ‘8🀩3πŸ€”1
Please open Telegram to view this post
VIEW IN TELEGRAM
❀3πŸ‘1πŸ”₯1
CHALLENGE

const array = [1, 2, [3, 4, [5, 6]]];
const result = array.flat(2).map(n => n * 2);

console.log(result);
πŸ”₯5πŸ‘4🀩1
πŸ‘9🀣4❀2πŸ”₯1🀩1
This media is not supported in your browser
VIEW IN TELEGRAM
πŸŒ• Did you hear? Google Chrome now comes with its Gemini Nano model. (It will be in your browser already.)

Soon, all websites will start using WebAI because the model will run on your computer, and they won't need to spend resources on it.

Narek Hakobyan
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘20πŸ€”12πŸ”₯9❀4🀣4
CHALLENGE

const array = [1, 2, [3, 4, [5, 6]]];
const result = array.flat(2).map(n => n * 2);

console.log(result);
πŸ‘3
🀣21πŸ€”14πŸ‘9πŸ”₯4🀩1
🀩 SquirrellyJS 9: A Powerful Template Engine

A modern, configurable, and fast template engine promising β€œthe power of Nunjucks” and β€œthe simplicity of EJS”. There’s an online playground if you want to see it in action.

Ben Gubler
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘4❀2πŸ”₯2
πŸ˜†
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣71πŸ”₯5πŸ‘2🀩2
CHALLENGE

const array = [1, 2, 3, 4, 5];
const [first, ...rest] = array;

const modified = rest.map((n, i) => i % 2 === 0 ? n * 2 : n);

console.log(first, modified);
❀9πŸ‘4
πŸ‘9
πŸ˜‚
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣108πŸ‘9❀4πŸ”₯1
CHALLENGE

const obj = { a: 1, b: 2 };
const proxy = new Proxy(obj, {
get(target, prop) {
return prop in target ? target[prop] : 0;
}
});

console.log(proxy.a, proxy.b, proxy.c);
❀11πŸ”₯3πŸ‘2
❀6
✌️ How to Annul Promises in JavaScript

You can 'cancel' XHR and fetch requests, but can you cancel regular promises? Currently, no, but Zachary looks into doing the next best thing: telling a promise the game's up, and discarding/ignoring its eventual results.

Zachary Lee
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘7
CHALLENGE

const array = [1, 2, 3];
array[10] = 4;

console.log(array.length);
console.log(array.includes(undefined));
πŸ‘21πŸ€”12❀11🀣6
πŸ“Š Sliderland: A Minimalist Coding Playground

A slider control based visualization you can code with simple formulas. We last linked to this a few years ago, but it’s still a fun way to do some quick, visual JS math experimentation. Tixy.land is along similar lines, but based on a 2D grid.

blinry
Please open Telegram to view this post
VIEW IN TELEGRAM
❀8πŸ‘4πŸ”₯1
CHALLENGE

const obj = {
a: 1,
b() {
return this.a;
}
};

const b = obj.b;
console.log(b.call({ a: 2 }));
πŸ‘20❀5🀩2
What is the output?
Anonymous Quiz
54%
2
20%
1
17%
undefined
9%
Error
πŸ‘2
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯4❀3🀩3