Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. /***
  2. * What will be the output of this code and why?
  3. */
  4. let obj = { a: 1 };
  5. let objb = { a: 1 };
  6.  
  7. if ({ a: 1 } === { a: 1 }) {
  8. console.log("Monday");
  9. } else if ({ a: 1 } == { a: 1 }) {
  10. console.log("Tuesday");
  11. } else if (obj == { a: 1 }) {
  12. console.log("Wednesday");
  13. } else if (obj == objb) {
  14. console.log("Thursday");
  15. } else if (Object.is(obj, objb)) {
  16. console.log("Friday");
  17. } else {
  18. console.log("Saturday");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement