hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.7K
active users

Daniel Coulbourne

I have made a helpful mnemonic to help myself remember the name of the Javascript method for checking if an array contains a certain element.

I think I'm going to adopt the position that all languages should have both an "includes" and a "contains" method on both array and string.

They should be aliases.

@coulb why can’t the set .has and the array .includes match?

@mattlehrer Some things are not for us to know. We're just stupid dumbasses, not genius language designers.

@coulb well there's the old "indexOf" that starts with an 'I' which is what "includes" starts with as well. 😉

@pdepanderetta @coulb "you're old fashioned" - lol
it's ok I still use it too.

@coulb It’s such a shame it couldn’t be .contains(), I get it wrong roughly absolutely all the time.