Advertisement
alexander_bazhenov

Untitled

Apr 9th, 2024
897
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. foo = "aaa"
  2. bar = foo + null
  3. console.log(foo);
  4. // aaa
  5.  
  6. foo = null
  7. bar = foo + "aaa"
  8. console.log(foo);
  9. // null
  10.  
  11. foo = "aaa"
  12. bar = foo + 5
  13. console.log(foo);
  14. // aaa
  15.  
  16. foo = 5
  17. bar = foo + "aaa"
  18. console.log(foo);
  19. // 5
  20.  
  21. // особенно мне нравится конверсия из int в str:
  22. // https://stackoverflow.com/questions/5765398/whats-the-best-way-to-convert-a-number-to-a-string-in-javascript
  23. // я то думал str(5) ))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement