even stensberg (2016-04-17T19:42:59.000Z)
evenstensberg at gmail.com (2016-04-17T19:51:02.326Z)
Could we use XOR? We would set the variable to false by default, meaning if it doesn't contain any values, it will return the OR property. By example: true is a string and boolean in the first example and boolean in the other one. `var false = false || 'true'` This means: false XOR false XOR true = true if it is set, we use true XOR true XOR false = false , which will return the value of our variable. Example by function: ` function() { var false = true evalToTrue() // outputs 'true' }` `function() { var false = false evalToTrue() // outputs the value of false }` `evalToTrue()` here means the XOR calculation. This might be a duplicate of what someone else have already said though, we can swap out falsy with undefined etc I assume.
evenstensberg at gmail.com (2016-04-17T19:48:00.329Z)
Could we use XOR? We would set the variable to false by default, meaning if it doesn't contain any values, it will return the OR property. By example: true is a string and boolean in the first example and boolean in the other one. `var false = false || 'true'` This means: false XOR false XOR true = true if it is set, we use true XOR true XOR false = false , which will return the value of our variable. Example by function: ` function() { var false = true evalToTrue() // outputs 'true' }` `function() { var false = false evalToTrue() // outputs the value of false }` `evalToTrue()` here means the XOR calculation. This might be a duplicate of what someone else have already said though.
evenstensberg at gmail.com (2016-04-17T19:47:23.373Z)
Could we use XOR? We would set the variable to false by default, meaning if it doesn't contain any values, it will return the OR property. By example: true is a string and boolean in the first example and boolean in the other one. `var false = false || 'true'` This means: false XOR false XOR true = true if it is set, we use true XOR true XOR false = false , which will return the value of our variable. Example by function: ` function() { var false = true evalToTrue() // outputs 'true' }` This might be a duplicate of what someone else have already said though. `function() { var false = false evalToTrue() // outputs the value of false }` `evalToTrue()` here means the XOR calculation.
evenstensberg at gmail.com (2016-04-17T19:43:49.986Z)
Could we use XOR? We would set the variable to false by default, meaning if it doesn't contain any values, it will return the OR property. By example: true is a string and boolean in the first example and boolean in the other one. `var false = false || 'true'` This means: false XOR false XOR true = true if it is set, we use true XOR true XOR false = false , which will return the value of our variable. Example by function: ` function() { var false = true evalToTrue() // outputs 'true' }` `function() { var false = false evalToTrue() // outputs the value of false }` `evalToTrue()` here means the XOR calculation.