当前位置:网站首页>Mistakes in Niuke JS exercise

Mistakes in Niuke JS exercise

2022-06-11 07:08:00 Not coriander

1. var a = parseInt([0,0,1,0,0].join(’’)+1) a The value of is
 Insert picture description here

stay JS There are only three types of conversion in , Namely :
Convert to Boolean
Convert to number
Convert to string
Four arithmetic sums ==、 Conditional operations are implicitly typed .
Addition operation character string + Numbers Convert a number to a string Such as 111+‘222’=“111222”
Non additive operation character string - x / Numbers Convert string to number Such as ’111’-11=100

 Insert picture description here
2. Which of the following expressions has a value of true?
 Insert picture description here
Any number divided by 0 Will cause errors and terminate program execution . But in JavaScript in , Will return a special value , Therefore, it will not affect the execution of the program .
Than 0 Divide a large number by 0, You will get infinity , therefore js use Infinity To show .
That is to say 1/0 Get is Infinity.isNaN(1/0) The return is false. however isNaN(0/0) Back to you true
3. Here's about JavaScript What is wrong in your description is
 Insert picture description here

原网站

版权声明
本文为[Not coriander]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203020524015235.html