A commonly encountered way to give readers easier access to source shared on the Web. David Bushell has an interesting followup reflecting on his own experiences implementing the same feature.
Salma Alam-Naylor
Please open Telegram to view this post
VIEW IN TELEGRAM
π8β€2π₯2
CHALLENGE
let person = {
name: 'Alice',
age: 30,
valueOf: function() {
return this.age;
}
};
let result = person + 10;
console.log(result);
π10β€4π₯1π€1
π€£32π€23π11β€3
Please open Telegram to view this post
VIEW IN TELEGRAM
1π€£39π8π₯6β€2
CHALLENGE
const numbers = [1, 2, 3, 4, 5];
const result = numbers
.filter(num => num % 2 === 0)
.map(num => num * num)
.reduce((acc, num) => acc + num, 0);
console.log(result);
π13β€2π€£1
π₯25π8π€8β€2π€£1
CHALLENGE
const sym1 = Symbol('description');
const sym2 = Symbol('description');
const obj = {
[sym1]: 'value1',
[sym2]: 'value2'
};
console.log(obj[sym1]);
π8π₯3β€1
π€£16π9π€4β€1
Think the GitHub contributions heat map. No dependencies, small, responsive, and theme-able. Thereβs a live demo or its GitHub repo.
William Troup
Please open Telegram to view this post
VIEW IN TELEGRAM
π11π₯5β€3
CHALLENGE
function trickyScope() {
var x = 10;
if (true) {
let x = 5;
console.log(x);
}
console.log(x);
}
trickyScope();
π₯9β€4
π₯10π€7π5π€£5β€3
CHALLENGE
function trickyScope() {
var a = 10;
let b = 20;
const c = 30;
if (true) {
var a = 40;
let b = 50;
const c = 60;
console.log(a, b, c);
}
console.log(a, b, c);
}
trickyScope();
π18π€£8β€6π€2
What is the output?
Anonymous Quiz
12%
40 50 60 10 50 60
29%
40 50 60 40 20 30
50%
40 50 60 10 20 30
9%
40 50 60 40 50 30
β€19π11π₯6
CHALLENGE
function trickyFunction(num) {
let result = 0;
for (let i = 0; i < num; i++) {
result += i;
if (i % 2 === 0) {
result *= 2;
} else {
result -= 1;
}
}
return result;
}
console.log(trickyFunction(4));
π7β€2π₯1
π€30π16β€2π₯2
I know this sounds like a geographical piece, but this developerβs curiosity led to a fun blend of JavaScript and the always useful Overpass Turbo mapping tool.
Ivan Ludvig
Please open Telegram to view this post
VIEW IN TELEGRAM
π5β€4π₯1