Do you think about JS as you should?

JSwL: Episode 2

JavaScript, like so many other languages out there, comes with a mindset. Your perspective towards JS will determine your direction and how well you understand it.

Here are 3 quotes

“I am not content, nor should you be, with stopping once something just works and not really knowing why. I gently challenge you to journey down that bumpy ‘road less traveled’ and embrace all that JavaScript is and can do.

With that knowledge, no technique, no framework, and no popular buzzword acronym of the week will be beyond your understanding.” - Kyle Simpson

“Thinking like a programmer is simple. The key is to know how to break problems down into smaller ones.

When you’re done breaking the problem down, find solutions for your small problems and code them up. Along the way, you’ll discover more problems you didn’t think of before. Solve them too.” - Freecodecamp

“One of the hardest things to learn in programming is not the syntax you need to learn, but how to apply it to solve real-world problems. You need to start thinking like a programmer — this generally involves looking at descriptions of what your program needs to do, working out what code features are needed to achieve those things, and how to make them work together.” - mdn

2 code samples

Still scratching the basics

// sample 1
let a = 21;
let b = a * 2; // a * 2 = 4
console.log(b); // output = 4

//sample 2
let x, y, x // initialize 3 variables
x = 5
y = 6
z = x + y // 5 + 6
console.log(z) // output = 11

1 exercise

Something basic to get your hands dirty

let x, y, x // initialize 3 variables
x = 5
y = 6
z = x + y * 10
console.log(z) // output = ?

That's a wrap for this episode, see you on the next one.