It don't mean a thing

It don't mean a thing
0.0 0

#1

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

#2

As a jazz lover and player, I highly approve.


#3

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.


#4

True, I could bring it up to > 2015…


#5

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.


#6

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…


#7

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


#8

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?”…


#9

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"]]);
}

#10

Maybe something like this:

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

#11

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: