[JavaScript] Number.parseFloat vs parseFloat
本篇文章屬個人見解,若有錯誤部分,請不吝指教
版本:ECMAScript 2015/ES6
說明
簡單來說,Number.parseFloat()跟parseFloat()就是一樣的功能,而為什麼在ES2015之後,會出現一樣的Function呢,這是為了模組化。所以未來也許parseFloat會被移除也說不定呢。
Get Leisure Rife’s stories in your inbox
Join Medium for free to get updates from this writer.
MDN裡Number.parseFloat的說明
This method has the same functionality as the global parseFloat() function:Number.parseFloat === parseFloat; // trueThis method is also part of ECMAScript 2015. (Its purpose is modularization of globals.)

![[Express.js] Setting Up Hot Reloading with Nodemon](https://miro.medium.com/v2/resize:fit:1358/format:webp/1*l3VnpfDzgaOjMz8GKX3PNg.png)
![[在日生活] 沒用途的收據如何變現金](https://miro.medium.com/v2/resize:fit:1358/format:webp/1*gsyXAovLozql3JvKwF00eg.png)

![[工程師日程] Code Review程式碼審查實踐要點](https://miro.medium.com/v2/resize:fit:1358/format:webp/1*0b29RrA4e7baVoMOa7XRvA.png)




