⚖️dot notation vs. decimal point

🚧 施工中

JSvaluesobjectpropertynamedot notation ⟩ vs. decimal point

  • dot notation (.):refers to an object's member.

  • decimal point:used for number literals.

// ⭐️ differantiate "dot notation" from a "decimal point"

// • method 1: use "white spaces"
77 .toExponential(),    // (an extra) space

77                      // new line
.toExponential(),

// • method 2: use (...)
(77).toExponential(),   // (recommended) ⭐️ 

// • method 3: use explicit "."
77..toExponential(),    // 77. === 77.0
77.0.toExponential(),   // 0 is optional

Last updated