Number,parseint,parsefloat function
Console.group (' number '); Console.log (Number (true));//1Console.log (Number (false));//0Console.log (Number (' 0011 '));// OneConsole.log (Number (' 0xf '));// theConsole.log (Number (' 123a '));//NaNConsole.log (Number (")");//0Console.groupend (); Console.group (' Unary plus operator '); Console.log (+true);//1Console.log (+false);//0Console.log (+ ' 0011 ');// OneConsole.log (+ ' 0xf ');// theConsole.log (+ ' 123a ');//NaNConsole.log (+ ");//0Console.groupend (); Console.group (' Parseint '); Console.log (parseint (‘‘));//NaNConsole.log (parseint (' 0xA '));//TenConsole.log (parseint (' 0xa '));//TenConsole.log (parseint (' 07 '));//7Console.log (parseint (' 123a '));//123Console.log (parseint (' 123.4.5 '));//123Console.groupend (); Console.group (' Parsefloat '); Console.log (parsefloat (‘‘));//NaNConsole.log (parsefloat (' 0xA '));//0Console.log (parsefloat (' 07 '));//7Console.log (parsefloat (' 123a '));//123Console.log (parsefloat (' 123.4.5 '));//123.4Console.groupend ();
Number,parseint,parsefloat function