Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. /*
  2. "Ложные значения" дают:
  3. - undefined;
  4. - null;
  5. - false;
  6. - +0, -0, NaN;
  7. - "";
  8.  
  9. Все, что не входит в этот список - даст истину.
  10. */
  11.  
  12.  
  13. //// Объектные обертки всегда дают true
  14. let
  15. a = new Boolean(false),
  16. b = new Number(0),
  17. c = new String("");
  18.  
  19. let d = Boolean(a && b && c);
  20. // console.log(d);
  21.  
  22. // а вот коллекция document.all даст false
  23. let dca = document.all;
  24. // console.log(Boolean(dca));
  25.  
  26. let a = 'hello world';
  27.  
  28. ~a.indexOf('lo')
  29. console.log(~a.indexOf('lo'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement