Skip to content

Commit 1c4b58e

Browse files
authored
Merge pull request chuanxshi#137 from christianbirg/patch-1
Update parseint.html
2 parents b6e34ea + 5c5eefe commit 1c4b58e

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

general-patterns/parseint.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,18 @@
2727
*/
2828
+"08" // result is 8
2929
Number("08") // 8
30-
30+
31+
//pattern 3
32+
/* NOTE: Bit operator parsing to int and chunk float vars, if a string has characters it return zero (0)
33+
*
34+
*/
35+
("789"|0) // => 789
36+
("sds"|0) // => 0
37+
(8.45|0) // => 8
38+
("8.55"|0) // => 8
3139

3240
// References
3341
// http://net.tutsplus.com/tutorials/javascript-ajax/the-essentials-of-writing-high-quality-javascript/
3442
</script>
3543
</body>
36-
</html>
44+
</html>

0 commit comments

Comments
 (0)