(ES6) ES6 (2016)

Coersion (CR23)

   1:  const num = 42;
   2:  const str = String(num);        // Number to string
   3:  const bool = true;
   4:  const strBool = String(bool);  // Boolean to string
   5:  console.log(strBool)
   6:  const big = 1234567890123456789n;
   7:  const strBig = String(big);    // BigInt to string
   8:  console.log(strBig)
   9:  const nul = null;
  10:  const strNul = String(nul);    // Null to string
  11:  console.log(strNul)
  12:  const und = undefined;
  13:  const strUnd = String(und);  // Undefined to string
  14:  console.log(strUnd);
  15:  const special = NaN;
  16:  const strSpecial = String(special); // NaN to string.
  17:  console.log(strSpecial); // "NaN"



String Conversions:

true
1234567890123456789
null
undefined
NaN





Coersion context:






ES6 context:



Comments ( )
<00>  <01>  <02>  <03>  <04>  <05>  <06>  <07>  <08>  <09>  <10>  <11>  <12>  <13>  <14>  <15>  <16>  <17>  <18>  <19>  <20>  <21>  <22>  <23>  <24>  <25
Link to this page: http://www.vb-net.com/JavascriptES6/CR23.htm
<TAGS>  <ARTICLES>  <FRONT>  <CORE>  <MVC>  <ASP>  <NET>  <DATA>  <TASK>  <XML>  <KIOSK>  <NOTES>  <SQL>  <LINUX>  <MONO>  <FREEWARE>  <DOCS> <TRAVELS> <FLOWERS> <RESUME> < THANKS ME>