Daily Archives: August 17, 2018

js convert to number

在要轉成number型態時 可用 |0的方式 null | 0 = 0 undefined | 0 = 0 “” | 0 = 0 true | 0 = 1 false | 0 = 0 但注意 | operator有32 bit限制 如果是像 unix timestamp milliseconds的”字串” (例如從網路傳上來) 轉成number時 “1534478379792”|0 = … Continue reading

Posted in nodejs | Leave a comment