It don't mean a thing

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
1 Like

As a jazz lover and player, I highly approve.

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

Other than that, go for it.

True, I could bring it up to > 2015…

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…

I got what you were doing and was amused :slight_smile: . I was just commenting on the code part.

Of course, as you point out, I’m not evaluating them at all. Can you think of a better way of representing “it don’t mean a thing?”…

You’d probably want to tweak it to make the best reference to the song, but from a an implementation standpoint maybe something more like

function whatDoesItMean(it) {
    if(!it.hasOwnProperty("thatSwing") {
        return "not a thing";
    }
    sing([["doo wah", "doo wah", "doo wah", "doo wah"],
          ["Doo wah", "doo wah", "doo wah", "doo wah"]]);
}
1 Like

Maybe something like this:

let it = new Object();
if (!it.hasOwnProperty("thatSwing")) {
  it.meaning = undefined;  // or "none"
}
1 Like

this would fit more nicely on a shirt:

if (!it.swing) it = '';

// doo wah, doo wah, doo wah, doo wah

:stuck_out_tongue_winking_eye: