Created
August 28, 2017 18:51
-
-
Save camilomontoyau/db66b643b4895dd0f2920fba41a820e2 to your computer and use it in GitHub Desktop.
javascript tip of the day 2017-08-28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g = { | |
a: 'r', | |
b: 5, | |
c: '' | |
}; | |
console.log('(g.a)', (g.a)); //(g.a) r | |
console.log('(g.b)', (g.b)); //(g.b) 5 | |
console.log('(g.c)', (g.c)); //(g.c) | |
console.log('(g.d)', (g.d)); //(g.d) undefined | |
console.log('!(g.a)', !(g.a)); //!(g.a) false | |
console.log('!(g.b)', !(g.b)); //!(g.b) false | |
console.log('!(g.c)', !(g.c)); //!(g.c) true | |
console.log('!(g.d)', !(g.d)); //!(g.d) true | |
console.log('!!(g.a)', !!(g.a)); //!!(g.a) true | |
console.log('!!(g.b)', !!(g.b)); //!!(g.b) true | |
console.log('!!(g.c)', !!(g.c)); //!!(g.c) false | |
console.log('!!(g.d)', !!(g.d)); //!!(g.d) false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment