網絡安全 + IT + Programming + Javascript

Javascript V8 嚴重問題!留意返

Javascript V8 嚴重問題!留意返

暫時測試用番 null === undefined 取代就無事

// Result not consistent : 12291 false, 37709 true
for(var i=0; i<50000; ++i) {
	console.log(typeof null === 'undefined')
}
// OR
for(var i=0; i<50000; ++i) {
	console.log(typeof null == 'undefined')
}

// Quick fix
for(var i=0; i<50000; ++i) {
	console.log(null === undefined)
}

Weak Typing Implicit Conversion....

不過同大家講番聲用 Weak Typing 嘅 Language 其實要好小心,因為 Implicit convert 好方便,同時都會好易中伏!

留意返!

除咗 Chrome 50、51 Chromium Issue。
Node 6.2.1 一樣中招詳見 GitHub Issue

唔好睇少一個 Boolean,一個 Boolean 錯足以引發世界級災難。

誇張啲講,一個發射核彈嘅程式,由 false 變 true ... 一發不可收拾

Patreon - 支持 Gap R&D 一些有趣的 Technical Blogs
GLT 討論社群 - 與 Gap 零距離討論 IT 日常、與社群交流最新技術
Join GLT Community