Learn the very essential basics of JavaScript if you are a total beginner
JavaScript can be very confusing at the beginning of your learning journey, but mastering these essential JavaScript terms will speed up your learning process.
This article is intended for new learners who want to learn more about JavaScript and become front-end developers.
After I’d mastered HTML and CSS, it was time to learn JavaScript. I recalled how stressful it had been for me, and how my confusion had grown with each passing day. I couldn’t tell the difference between objects, methods, functions, and so on. One part of me understood everything, but when it came to solving my own challenges, I was totally lost. I started watching various tutorials, but the problem was that I didn’t understand the fundamentals of JavaScript.
Now we will start focusing on the most important concepts that you should understand before starting to practice JavaScript. It can significantly help you and save you time. It’s normal if you do not really understand it all straight away, but you should read the documentation or watch some YouTube tutorials for clarity.
You can, however, contact me, it will be my pleasure to assist you.
Let’s start with the fundamentals:
What exactly is JavaScript?
JavaScript is a programming language that is widely used throughout the world to develop dynamic and interactive web content such as applications and browsers.
What exactly is JavaScript data?
To be able to operate on variables, it is important to know something about the data type. Data that is not an object and does not have any methods or properties are called primitives. There are seven of them in JavaScript.
Can you list JavaScript primitives?
Primitives are number, boolean, string, undefined, BigInt, symbol, and null.
Number
It is basically a number. For example 1, 5, 10.3, -11.
Boolean
True and false statements are the two values of a boolean. For example, today is snowing so it is too cold // True.
String
Strings are used for storing text/characters. For example, “Hello World” is a string of characters.
What’s the difference between null and undefined?
The variable undefined refers to something that does not exist and is not defined to be anything.
A null variable is one that has been defined but does not have a value.
What are the JavaScript objects?
It is used to store keyed collections as well as more complex entities.
Consider a cup as an example. A cup is a physical object with properties. A cup has a color, a design, a weight, a material made of, and so on. JavaScript objects, too, can have properties that define their characteristics.
How can I store different elements in JavaScript?
One answer is an array.
An array is an object that can store multiple values at once.
What is a return in JavaScript?
A return statement stops the execution of a function and returns a value.
But how can we perform a specific task?
We use a JavaScript function for this. A JavaScript function is a block of code designed to perform a specific task. There are three types of JavaScript functions.
Function declaration, functional expression, and arrow function.
You will hear about JavaScript and JavaScript ES6. Thus, JavaScript is a programming language, and JavaScript ES6 is a version of draft ECMAScript (ES is a scripting language specification standardized by ECMA International.) in which many features have been introduced.
JavaScript ES6 has a few improvements, that can help you a lot as a junior developer. It is very important to practice them and understand them deeply.
Variables
Before ES6, variables were declared as var only.
After ES6, we have 2 new types of variable declarations:
Let variable — they can be re-declared;
Const variable — they are constants and cannot be re-declared;
Arrow functions
Arrow functions allow writing a concise syntax for writing function expressions. You don’t need the function keyword, the return keyword, and the curly braces. It is much simpler and easier to write functions with Arrow functions.
The Spread (…) Operator
The JavaScript spread operator (…) allows us to quickly copy all or part of an existing array or object into another array or object.
There are a lot of new features, but I’ll leave that up to you. Take your time and explore them in depth.
A brief summary of all terms
JavaScript is a programming language for creating dynamic web content such as applications and browsers.
- JavaScript primitives are data and we have 7 types.
- Strings are text or characters.
- Boolean can be true or false.
- Undefined does not exist and is undefined, while null is defined but lacks a value.
- A JavaScript object is stored data.
- An array is an object that stores a lot of data.
- Return is used to return a value and stop the function.
- JavaScript functions are a group of code to perform a specific task.
- Const is a constant, you cannot change the value.
- Let variable is used to change the value.
- Arrow functions are an easier way to write functions.
- The Spread (…) operator is used when you want to copy an entire part of an array to another array.
Conclusion
JavaScript is so popular and starting to learn it is a great skill you can learn. Every beginning is difficult, so don’t pressure yourself too much. Everything seems confusing and makes no sense, but trust me with practice, watching tutorials, and reading docs, everything will be much easier. Trying to understand all the terminology in this topic, and I’m about to have an interesting topic called JavaScript methods, so wait for the new Medium blog.