JavaScript
32.1K subscribers
1.06K photos
10 videos
33 files
737 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
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘10❀62
❓ CHALLENGE

const num = 8;
const obj = {
num: 10,
inner: {
num: 6,
getNum: function() {
return this.num;
}
}
};
console.log(obj.inner.getNum());
const getNum = obj.inner.getNum;
console.log(getNum());
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘12πŸ€”4❀2
19πŸ‘11πŸ€”9
🀟 Node.js Updates: Text Styling (v21.7.0)

Sometimes minor Node versions have little beyond bug fixes, but other times you get some new features, and 21.7 doesn’t disappoint. Node gains a new util.styleText() function for formatting text (including with color!), new functions to work with .env files, multi-line value support for .env files, a crypto.hash() function to more quickly compute digests in one shot (example), and more.

THE NODE.JS CORE TEAM
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘156❀3
❓ CHALLENGE

function* generateSequence() {
yield 1;
yield 2;
return 3;
}

const generator = generateSequence();
console.log(generator.next());
console.log(generator.next());
console.log(generator.next());
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘9🀣6❀4
πŸ“Š Plotly 2.30: A JavaScript Graphing Library

A high-level, declarative charting library, built on top of D3 and stack.gl, with over 40 chart types, including 3D charts, statistical graphs, and SVG maps.

PLOTLY, INC.
Please open Telegram to view this post
VIEW IN TELEGRAM
11❀4πŸ‘4
❓ CHALLENGE

function factorial(n) {
return n <= 1 ? 1 : n * factorial(n - 1);
}
console.log(factorial(5));
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ€”11πŸ‘1
What is the output?
Anonymous Quiz
63%
120
18%
20
13%
25
5%
15
πŸ‘22🀣7🀩11
✌️ Shiki 1.0: A Powerful Syntax Highlighter

A few months ago, we linked to Shikiji, a fork of Shiki that was created to push the project forward. Happily, the creators of both libraries decided to join forces and Shiki 1.0 was born. It’s a syntax highlighter based on TextMate grammar and themes, the same engine as used by VS Code. The docs are good.

PINE WU, ANTHONY FU
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘134❀2πŸ€”1🀩1🀣1
❓ CHALLENGE

const obj = {
value: 42,
getValue: function() {
return () => {
console.log(this.value);
};
}
};

const getValue = obj.getValue();
getValue();
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘17
What is the output?
Anonymous Quiz
59%
42
30%
undefined
8%
Error
3%
NaN
πŸ‘25πŸ€”97❀4
πŸ‘€ Voici.js: Pretty Table Printing for the Terminal

If you’ve got a collection of large objects to print out, this could be ideal as it can format them into a table, dynamically size the columns as appropriate, sort the output, and let you add styling into the mix (including colors.)

LARS WAECHTER
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘9❀11
❓ CHALLENGE

const obj = { a: 1, b: 2, c: 3 };
let result = "";
for (const [key, value] of Object.entries(obj)) {
result += key + value;
}
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
❀122
What is the output?
Anonymous Quiz
8%
abc
16%
123
8%
abbccc
69%
a1b2c3
πŸ‘2512❀5🀣4
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣237πŸ‘6
❀️ Wow, we are growing so fast!

We would like to ask for your help. Please boost us to continue sending stories on Telegram.

⚑️ Boost us in Telegram

✌️ JavaScript emoji pack for you
Please open Telegram to view this post
VIEW IN TELEGRAM
29❀13πŸ‘7πŸ€”1
❓ CHALLENGE

const string = "hello world";
const result = string.replace(/l/g, "");
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ€”127❀4
🀣38πŸ‘148❀3
πŸ‘€ The Playwright Test Generator

I don't know why I’ve not linked this before, as it’s so useful. Playwright isn’t just a library for controlling browsers from JavaScript, but also includes a tool for generating tests and page navigation code from your own interactions. Hit record, do stuff, and code is written.

MICROSOFT
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘106❀1🀣1
❓ CHALLENGE

console.log(typeof null);
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣3516πŸ€”9🀩4πŸ‘2