The introduction: You can understand JS too

JSwL: Episode 1

How well do you know JS?

Learning JS is a continuous process, there’s no end to it, you only get better.

JS is beautiful and fun depending on your grasp of its core mechanics.

Here are 3 definitions/quotes:

“JavaScript is a prototype-based, multi-paradigm, single-threaded, dynamic language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles.

JavaScript's dynamic capabilities include runtime object construction, variable parameter lists, function variables, dynamic script creation (via eval [a function that evaluates JS codes represented as strings]), object introspection, and source-code recovery.” - mdn docs

JavaScript was initially created to “make web pages alive”.

The programs in this language are called scripts. They can be written right in a web page’s HTML and run automatically as the page loads.

Why is it called JavaScript?

When JavaScript was created, it initially had another name: “LiveScript”. But Java was very popular at that time, so it was decided that positioning a new language as a “younger brother” of Java would help.

But as it evolved, JavaScript became a fully independent language with its own specification called ECMAScript, and now it has no relation to Java at all.” - JS info

“From the earliest days of the Web, JavaScript has been a foundational technology that drives interactive experience around the content we consume.

It is simultaneously a simple, easy-to-use language that has broad appeal, and a complex and nuanced collection of language mechanics that without careful study will elude true understanding even for the most seasoned of JavaScript developers.

Because JavaScript can be used without understanding, the understanding of the language is often never attained.” - Kyle Simpson

2 Code samples

Let’s go basic for the introduction

// initializing a variable (1)
 var a = 2

// initiate and call a simple function (2)
function sum(num) {
   return num + 2
}

console.log(sum(a)) // output = 4

1 Exercise

var a = 2

function sum(num) {
   return num + (2 - 1)
}

console.log(sum(a)) // output?

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

Connect with me on Twitter.