I’ve been thinking I want to put this on a shirt. I thought I’d run it past folks first to make sure there isn’t anything embarrassingly wrong about the code:
var it = new Object();
if (!it.hasOwnProperty("thatSwing")) {
it !== "a thing";
}
// doo-wah doo-wah doo-wah doo-wah
// doo-wah doo-wah doo-wah doo-wah
I am sure it will upset a lot of programming enthusiasts bashing you for using var and not let keyword along with everything that “they” think is not the standard. Lol
it !== "a thing" This is a test that would return either true (if it is not "a thing") or false (if it is "a thing"), but that boolean isn’t returned or assigned to anything. *
Did you mean something more like it["a thing"] = false;?
* ETA- actually, it would always return false because it is an object.
Hm… true, the code isn’t exactly functional. (I should perhaps explain that the allusion is to the Duke Ellington song “It Don’t Mean a Thing (If it Ain’t Got That Swing)”.)
Perhaps it would be a good idea if a thing were an object instead of a string, so it wouldn’t be quite so nonsensical to compare them…