Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
69
rated 0 times [  72] [ 3]  / answers: 1 / hits: 19888  / 12 Years ago, thu, december 20, 2012, 12:00:00

How can I flip the value of a boolean variable in javascript, without having to include the variable name twice?
So



foobarthings[foothing][barthing] = !foobarthings[foothing][barthing];


without writing foobarthings[foothing][barthing] twice.


More From » boolean

 Answers
40

There is no shorter way than what you currently have.


[#81307] Wednesday, December 19, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tylerdamiena

Total Points: 139
Total Questions: 90
Total Answers: 118

Location: Liechtenstein
Member since Wed, Dec 8, 2021
3 Years ago
tylerdamiena questions
;