Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Decimal Base Exponent shorthand javascript

// Decimal Base Exponents shorthand javascript
// Longhand:
for (let i = 0; i <= 10000; i++) {
    console.log(i);
  }
  
  // Shorthand:
  for (let i = 0; i <= 1e4; i++) {
    console.log(i);
  }
  // All the below will evaluate to true
  // 1e0 === 1;
  // 1e1 === 10;
  // 1e2 === 100;
  // 1e3 === 1000;
  // 1e4 === 10000;
 
PREVIOUS NEXT
Tagged: #Decimal #Base #Exponent #shorthand #javascript
ADD COMMENT
Topic
Name
4+9 =