JavaScript tips and tricks💡

A thread🧵

Never declare variables inside a for loop!
https://t.co/0NrXPBEeyL
Copy to clipboard
https://t.co/KZPc9s9M4I
Use "splice" instead of "delete".
https://t.co/4qc9R4Eeoj
Array of unique values.
https://t.co/2F2u3wZiOj
Avoid global variables.
https://t.co/bRAoq3Vx4F
Short circuit conditionals using AND operator.
https://t.co/DHNjQeXXEv
Quick Rounding using OR operator.
https://t.co/rg1TQ37bSQ
"toLocaleString" in JavaScript
https://t.co/n5verHAzjh
Comparing three numbers and how it works!
https://t.co/mgtL3wGSFp
Dynamic property in objects.
https://t.co/LkUWDkxwnJ
NaN🤯
https://t.co/reIYvi7FD4
How to not push node_modules to git!
https://t.co/awaQLKUVZw
Testing in JavaScript.
https://t.co/KUxSZTCHHJ

You May Also Like

1/“What would need to be true for you to….X”

Why is this the most powerful question you can ask when attempting to reach an agreement with another human being or organization?

A thread, co-written by @deanmbrody:


2/ First, “X” could be lots of things. Examples: What would need to be true for you to

- “Feel it's in our best interest for me to be CMO"
- “Feel that we’re in a good place as a company”
- “Feel that we’re on the same page”
- “Feel that we both got what we wanted from this deal

3/ Normally, we aren’t that direct. Example from startup/VC land:

Founders leave VC meetings thinking that every VC will invest, but they rarely do.

Worse over, the founders don’t know what they need to do in order to be fundable.

4/ So why should you ask the magic Q?

To get clarity.

You want to know where you stand, and what it takes to get what you want in a way that also gets them what they want.

It also holds them (mentally) accountable once the thing they need becomes true.

5/ Staying in the context of soliciting investors, the question is “what would need to be true for you to want to invest (or partner with us on this journey, etc)?”

Multiple responses to this question are likely to deliver a positive result.