63

JS 中可以提升幸福度的小技巧

 5 years ago
source link: https://juejin.im/post/5b51e5d3f265da0f4861143c
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
本文主要介绍一些JS中用到的小技巧,可以在日常Coding中提升幸福度,将不定期更新~ 1. 类型强制转换 1.1 string强制转换为数字 可以用*1来转化为数字(实际上是调用.valueOf方法) 然后使用Number.isNaN来判断是否为NaN,或者

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK