Millionβs mission is to make React apps faster and the new VS Code extension Million Lint takes a new approach: imagine ESLint but for suggesting performance improvements.
AIDEN BAI
Please open Telegram to view this post
VIEW IN TELEGRAM
π19 4β€2
const value = { number: 10 };
function increment(obj) {
obj.number++;
}
increment(value);
console.log(value.number);
Please open Telegram to view this post
VIEW IN TELEGRAM
π9β€5
What is the output?
Anonymous Quiz
21%
10
17%
TypeError: Cannot read property 'number' of undefined
7%
undefined
55%
11
π22 7β€3
const nums = [1, 2, 3, 4, 5];
const sum = nums.reduce((total, current) => {
return total + current * current;
}, 0);
console.log(sum);
Please open Telegram to view this post
VIEW IN TELEGRAM
π23β€6π€©2 1
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
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
π15 6β€3
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
π18 4β€2
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
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
π22π€£7π€©1 1
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
π13 4β€2π€1π€©1π€£1
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
π25π€9 7β€4
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β€1 1
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
β€12 2