Skip to content

Commit f783009

Browse files
committed
JavaScript Coding Techniques.. 🚀
1 parent 00b6f21 commit f783009

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Longhand:
2+
3+
for (let i = 0; i < 10000; i++) {}
4+
5+
// Shorthand:
6+
7+
for (let i = 0; i < 1e7; i++) {}
8+
9+
// All the below will evaluate to true
10+
1 === 1;
11+
1e1 === 10;
12+
1e2 === 100;
13+
1e3 === 1000;
14+
1e4 === 10000;
15+
1e5 === 100000;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Longhand:
2+
3+
const x = 1920,
4+
y = 1080;
5+
const obj = { x: x, y: y };
6+
7+
// Shorthand:
8+
9+
const obj = { x, y }; // es6 features

0 commit comments

Comments
 (0)