This content originally appeared on DEV Community and was authored by Heru Hartanto
I just found out some ? funny things about javascript, If someone able to explain I really appreciate
'A'+'A'
// output 'AA'
'1'+'1'
// output '11'
// Okay that make sense but ...
'1'+'1'*2
// output 12
'1'+'1'/2
// output 10.5
// It's start getting weird then ....
'1'-'1'
// output 0
'1'-'1'/2
// output 0.5
// It's correct , but why ?
This content originally appeared on DEV Community and was authored by Heru Hartanto
Print
Share
Comment
Cite
Upload
Translate
Updates
There are no updates yet.
Click the Upload button above to add an update.
![](https://www.radiofree.org/wp-content/plugins/print-app/icon.jpg)
APA
MLA
Heru Hartanto | Sciencx (2021-09-18T06:26:40+00:00) ‘1’ – ‘1’ / 2 = ? , Can you find the answer ?. Retrieved from https://www.scien.cx/2021/09/18/1-1-2-can-you-find-the-answer/
" » ‘1’ – ‘1’ / 2 = ? , Can you find the answer ?." Heru Hartanto | Sciencx - Saturday September 18, 2021, https://www.scien.cx/2021/09/18/1-1-2-can-you-find-the-answer/
HARVARDHeru Hartanto | Sciencx Saturday September 18, 2021 » ‘1’ – ‘1’ / 2 = ? , Can you find the answer ?., viewed ,<https://www.scien.cx/2021/09/18/1-1-2-can-you-find-the-answer/>
VANCOUVERHeru Hartanto | Sciencx - » ‘1’ – ‘1’ / 2 = ? , Can you find the answer ?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/09/18/1-1-2-can-you-find-the-answer/
CHICAGO" » ‘1’ – ‘1’ / 2 = ? , Can you find the answer ?." Heru Hartanto | Sciencx - Accessed . https://www.scien.cx/2021/09/18/1-1-2-can-you-find-the-answer/
IEEE" » ‘1’ – ‘1’ / 2 = ? , Can you find the answer ?." Heru Hartanto | Sciencx [Online]. Available: https://www.scien.cx/2021/09/18/1-1-2-can-you-find-the-answer/. [Accessed: ]
rf:citation » ‘1’ – ‘1’ / 2 = ? , Can you find the answer ? | Heru Hartanto | Sciencx | https://www.scien.cx/2021/09/18/1-1-2-can-you-find-the-answer/ |
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.