Soumettre la recherche
Mettre en ligne
20120525 equal identically_equal
•
Télécharger en tant que PPT, PDF
•
0 j'aime
•
159 vues
L
LearningTech
Suivre
Technologie
Signaler
Partager
Signaler
Partager
1 sur 13
Télécharger maintenant
Recommandé
Exception handling in asp.net
Exception handling in asp.net
LearningTech
ELMAH
ELMAH
Mindfire Solutions
vim
vim
LearningTech
PostCss
PostCss
LearningTech
ReactJs
ReactJs
LearningTech
Docker
Docker
LearningTech
Semantic ui
Semantic ui
LearningTech
node.js errors
node.js errors
LearningTech
Recommandé
Exception handling in asp.net
Exception handling in asp.net
LearningTech
ELMAH
ELMAH
Mindfire Solutions
vim
vim
LearningTech
PostCss
PostCss
LearningTech
ReactJs
ReactJs
LearningTech
Docker
Docker
LearningTech
Semantic ui
Semantic ui
LearningTech
node.js errors
node.js errors
LearningTech
Process control nodejs
Process control nodejs
LearningTech
Expression tree
Expression tree
LearningTech
SQL 效能調校
SQL 效能調校
LearningTech
flexbox report
flexbox report
LearningTech
Vic weekly learning_20160504
Vic weekly learning_20160504
LearningTech
Reflection & activator
Reflection & activator
LearningTech
Peggy markdown
Peggy markdown
LearningTech
Node child process
Node child process
LearningTech
20160415ken.lee
20160415ken.lee
LearningTech
Peggy elasticsearch應用
Peggy elasticsearch應用
LearningTech
Expression tree
Expression tree
LearningTech
Vic weekly learning_20160325
Vic weekly learning_20160325
LearningTech
D3js learning tips
D3js learning tips
LearningTech
git command
git command
LearningTech
Asp.net MVC DI
Asp.net MVC DI
LearningTech
Vic weekly learning_20151127
Vic weekly learning_20151127
LearningTech
Mocha.js
Mocha.js
LearningTech
R language
R language
LearningTech
20151120 ian cocos2d js
20151120 ian cocos2d js
LearningTech
Vic weekly learning_20151120
Vic weekly learning_20151120
LearningTech
Contenu connexe
Plus de LearningTech
Process control nodejs
Process control nodejs
LearningTech
Expression tree
Expression tree
LearningTech
SQL 效能調校
SQL 效能調校
LearningTech
flexbox report
flexbox report
LearningTech
Vic weekly learning_20160504
Vic weekly learning_20160504
LearningTech
Reflection & activator
Reflection & activator
LearningTech
Peggy markdown
Peggy markdown
LearningTech
Node child process
Node child process
LearningTech
20160415ken.lee
20160415ken.lee
LearningTech
Peggy elasticsearch應用
Peggy elasticsearch應用
LearningTech
Expression tree
Expression tree
LearningTech
Vic weekly learning_20160325
Vic weekly learning_20160325
LearningTech
D3js learning tips
D3js learning tips
LearningTech
git command
git command
LearningTech
Asp.net MVC DI
Asp.net MVC DI
LearningTech
Vic weekly learning_20151127
Vic weekly learning_20151127
LearningTech
Mocha.js
Mocha.js
LearningTech
R language
R language
LearningTech
20151120 ian cocos2d js
20151120 ian cocos2d js
LearningTech
Vic weekly learning_20151120
Vic weekly learning_20151120
LearningTech
Plus de LearningTech
(20)
Process control nodejs
Process control nodejs
Expression tree
Expression tree
SQL 效能調校
SQL 效能調校
flexbox report
flexbox report
Vic weekly learning_20160504
Vic weekly learning_20160504
Reflection & activator
Reflection & activator
Peggy markdown
Peggy markdown
Node child process
Node child process
20160415ken.lee
20160415ken.lee
Peggy elasticsearch應用
Peggy elasticsearch應用
Expression tree
Expression tree
Vic weekly learning_20160325
Vic weekly learning_20160325
D3js learning tips
D3js learning tips
git command
git command
Asp.net MVC DI
Asp.net MVC DI
Vic weekly learning_20151127
Vic weekly learning_20151127
Mocha.js
Mocha.js
R language
R language
20151120 ian cocos2d js
20151120 ian cocos2d js
Vic weekly learning_20151120
Vic weekly learning_20151120
20120525 equal identically_equal
1.
JAVASCRIPT EQUAL & IDENTICALLY
EQUAL By Anney 06/08/12 1
2.
開講前測驗
06/08/12 2
3.
開講前測驗 (2)
06/08/12 3
4.
EQUAL 與 IDENTICALLY
EQUAL 的差異 • 相等 (Equal, ==) 或 不相等 (Not Equal, !=) • 強制轉換資料型別後,再進行比較。 • 全等 (Identically Equal, ===) 或 不全等 (Not Identically Equal, !==) • 直接比較而不強制轉換資料型別。 06/08/12 4
5.
相等 (EQUAL, ==)
/ 不相等 (NOT EQUAL, !=) • 當比較兩個變數時 • 資料型態相同: • == 跟 === 的結果一樣,直接比較數值是否相等。 • 資料型態不同: • 就強制轉型 (type coercion) 後,再進行數值的比較。 06/08/12 5
6.
比較前轉換資料型態的規則 •
Boolean vs Number • false 轉成 0 ; true 轉成 1 ,再進行比較。 • String vs. Number • 將 String 轉成 Number 再進行比較。 • String 轉成 Number 可能會是 Number 或是 NaN 。 • Object vs. non-Object • 利用 valueOf() 將 Object 的值取出後,再依照上述的規則比較。 06/08/12 6
7.
比較前轉換資料型態的規則 (2) •
null 與 undefined 是相等的 ( 這裡指的是 == ,並非全等 ===) 。 • 在比較之前,不能將 null 與 undefined 轉換成其他值。 • 如果其中一個變數值是 NaN ,那麼在經過 == 的比較後,會 return false ,而 ! = 會 return true 。 有趣的是,即使兩個變數都是 NaN ,但是在經過 == 的比較後,還是會 return false 。 ( 因為 NaN 不等於 NaN) • 如果兩個變數型態都是物件 (Object) ,則比較兩者是否指向同一個物件,是就 return true ,不是則 return false 。 06/08/12 7
8.
再測驗一次,答案還一樣嗎?
06/08/12 8
9.
全等 (IDENTICALLY EQUAL,
===) / 不全等 (NOT IDENTICALLY EQUAL, !==) 06/08/12 9
10.
再測驗一次,答案還一樣嗎?
06/08/12 10
11.
REFERENCE •
http://zh.wikipedia.org/wiki/ECMAScript • http://kuro.tw/blog/2011/12/01/javascript-equal-identically-equal 06/08/12 11
12.
參考書目 •
Professional JavaScript for Web Developers • JavaScript: The Good Parts 06/08/12 12
13.
~ THE END
~ 06/08/12 13
Télécharger maintenant