why in javascript 3.toString () throws an exception and 3..toString () works fine? I saw this in a funny presentation about javascript, but I can't find the information WHY. Thank you in advance.
Since the decimal point is the real part of the number, so the first point is considered to be numeric, the second for the chain.
If you prefer to avoid a double period, you can:
(3).toString();
Or:
'' + 3;
String(3);
Source: https://habr.com/ru/post/1529965/More articles:VS2013 does not create min.css - cssAutomatically scale batch jobs on an elastic beanstalk - cloud@Transactional annotation, not starting transaction (Guice Persist) - javaСистема Linux ждет 90 секунд после вызова "poweroff" перед завершением работы в VMware - linuxangular event success on form submission opens popup - javascriptHow to import loader format data using SQLDeveloper? - importSymfony2 syntax error or access violation - phpHow to enter left parentheses in a text box - javaHow do I hide the sidebar on a GitHubs wiki page for specific pages? - githubHow to change the default value using the lines at the top of each class - c #All Articles