JavaScript
31.3K subscribers
1.21K photos
10 videos
33 files
877 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
😲 LiteParse 2: Fast, Light PDF Document Parsing

A PDF parser built in Rust with bindings for Node (plus WASM, Rust, and Python) — it worked great in my testing. It includes OCR, handles layouts/is spatially aware, and is fast (a complex 140-page PDF took ~10 seconds). Here's how to get started from Node.

LlamaIndex
Please open Telegram to view this post
VIEW IN TELEGRAM
5👍2
CHALLENGE

class Timer {
constructor() { this.seconds = 0; }
start() {
this.tick = () => { this.seconds++; return this.seconds; };
return this.tick;
}
}

const t = new Timer();
const tick = t.start();
const obj = { seconds: 100, tick };
console.log(tick(), obj.tick(), t.seconds);
👍2🔥1
What is the output?
Anonymous Quiz
33%
1 101 2
31%
1 2 2
15%
1 2 1
21%
NaN NaN NaN
4🔥1
🙂 Follow a Single HTTP Request Through Its ~200ms Life

From the creator of NodeBook, a thorough guide to Node's internals, comes a scroll-driven visualization following every step a single HTTP POST request takes from the user's click to Node's event loop and on to a database behind it.

Ishtmeet Singh
Please open Telegram to view this post
VIEW IN TELEGRAM
1👍1🔥1
CHALLENGE

const primArr = [1, 2, 3];
const copyArr = [...primArr];
copyArr[0] = 99;

const objArr = [{ x: 1 }, { x: 2 }];
const copyObjArr = [...objArr];
copyObjArr[0].x = 99;

console.log(primArr[0], copyArr[0], objArr[0].x, copyObjArr[0].x);
2
1
CHALLENGE

const arr = [1, [2, 3], [4, [5, 6]], 7];
const a = arr.flat();
const b = arr.flat(2);
const c = arr.flatMap(x => Array.isArray(x) ? x : [x, x]);
const d = [1, 2, 3].flatMap(x => [[x]]);
console.log(JSON.stringify([a, b, c, d]));
CHALLENGE

const source = {
_val: 1,
get val() { return this._val; }
};
const copy1 = Object.assign({}, source);
source._val = 100;
const copy2 = { ...source };
copy1._val = 999;
console.log(copy1.val, copy2.val, source.val, copy1._val);
4🔥1🤣1
3