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
β˜„οΈβœŒοΈ QuickJS: The Small, Embeddable JavaScript Engine

Several years ago, Fabrice Bellard, the genius behind FFMPEG and JSLinux, built a tiny and complete JavaScript engine in C. It now supports ES2023 and its latest release adds top-level await in modules and its REPL, as well as support for some cutting edge JS features (changelog).

FABRICE BELLARD
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘9❀44🀩1
❓ CHALLENGE

async function asyncQuiz() {
console.log("Start");

const promise1 = new Promise((resolve) => {
setTimeout(() => resolve("Promise 1"), 1000);
});

const promise2 = new Promise((resolve) => {
setTimeout(() => resolve("Promise 2"), 500);
});

console.log(await promise1);
console.log(await promise2);

console.log("End");
}

asyncQuiz();
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘2
✌️🍊 Jint 3.0: A JavaScript Interpreter for .NET

Run JavaScript within a .NET app and expose .NET objects and functions to JavaScript code. v3 arrives after seven years of work and is the most standards-compliant JS engine running entirely within .NET.

SÉBASTIEN ROS
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘8❀41
❓ CHALLENGE

const fetchData = async (id) => {
return new Promise((resolve) => {
setTimeout(() => resolve(`Data for ID ${id}`), 100);
});
};

const ids = [1, 2, 3];

async function complexAsyncFetch(ids) {
const result = await ids.reduce(async (acc, id) => {
const data = await fetchData(id);
const currentResult = await acc;
currentResult.push(data);
return currentResult;
}, Promise.resolve([]));

console.log(result);
}

complexAsyncFetch(ids);
Please open Telegram to view this post
VIEW IN TELEGRAM
❀5
πŸ˜‚ Nice life hack
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣71πŸ‘1211❀3🀩3πŸ€”1
❓ CHALLENGE

function recursiveFibonacci(n) {
return n <= 1 ? n : recursiveFibonacci(n - 1) + recursiveFibonacci(n - 2);
}

const result = recursiveFibonacci(6);

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘9
πŸ€”168❀5πŸ‘5
🀣 So true…
Please open Telegram to view this post
VIEW IN TELEGRAM
🀣107πŸ‘10❀43
❓ CHALLENGE

function recursivePalindromeCheck(str) {
if (str.length <= 1) {
return true;
}

return str[0] === str[str.length - 1] && recursivePalindromeCheck(str.slice(1, -1));
}

const result = recursivePalindromeCheck("radar");

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
21πŸ‘2
πŸ‘95❀3πŸ€”3
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘14🀩33❀2πŸ€”2
❓ CHALLENGE

function recursiveBinarySearch(arr, target, start = 0, end = arr.length - 1) {
if (start > end) {
return -1;
}

const mid = Math.floor((start + end) / 2);

if (arr[mid] === target) {
return mid;
} else if (arr[mid] < target) {
return recursiveBinarySearch(arr, target, mid + 1, end);
} else {
return recursiveBinarySearch(arr, target, start, mid - 1);
}
}

const result = recursiveBinarySearch([1, 2, 3, 4, 5, 6, 7, 8, 9], 6);

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
❀12πŸ‘1
What is the output?
Anonymous Quiz
35%
5
36%
6
12%
4
16%
-1
πŸ€”9πŸ‘86🀣4❀3🀩2
πŸ‘€A Step-by-Step Tutorial on Deploying Node.js Apps on AWS EC2

Taking the manual, 'do it all by hand' approach. A good way to learn about all the pieces involved before automating it, perhaps.

SAM MEECH-WARD
Please open Telegram to view this post
VIEW IN TELEGRAM
❀9πŸ‘42
❓ CHALLENGE

function recursiveReverseString(str) {
return str === "" ? str : recursiveReverseString(str.substr(1)) + str[0];
}

const result = recursiveReverseString("hello");

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
15🀣8❀5🀩4πŸ‘2
What is the output?
Anonymous Quiz
36%
"hello"
11%
"hell"
42%
"olleh"
11%
"h"
πŸ€”19πŸ‘127❀6🀩4
❓ CHALLENGE


const obj = {
0: 'a',
1: 'b',
length: 2
};

const result = Array.from(obj);

console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
11πŸ‘8❀1