Basic discussion for Absolute beginner who want to learn JavaScript.

AJ Auntor
5 min readMay 7, 2021

--

AJ Auntor JavaScript Blog.

01. What is JavaScript ?

Basically JavaScript is a scripting language, and also dynamic programming language. “Brendan Eich” is creator of JavaScript, When it first came on to the market, the purpose was simply to bring web interactions to Web browser for good user experience. JavaScript first released December 4, 1995, But in the last 25 years, JavaScript has become a full-fledged and smart programming language. Now JavaScript use for Creating web apps, Mobile apps, Game Development and also Adding interactive behavior in Websites.

02. Basic JavaScript Output.

Every language has own rule to show output, JavaScript also displays its output according to a set of rules. Suppose now I will show you how to show the “Hello World” as the output.

console.log(“Hello, World!”);

03. What is JavaScript Variable ?

Variable works the same way in all programming languages. JavaScript variable is a symbolic name that represents a specified value. The reason for using variables is to store any information so that it can be used later in the code. If we compare the name of a variable with a bag, then all the things inside the bag are data. Data can be easily moved or used by variable names.

04.What is JavaScript Data Type ?

There are different types of data types in JavaScript to hold different values, that is, to work with different types of data. Such as one type for any text or text, different type for any number etc. Data type is a major consideration in any programming language. When working with a variable, it is important to know what type of data it is, for example, see the code below.

var x= 10 + Computer;

The data type is not specified here, “Computer” will display this text by adding 10. that is, it will display the text “10Computer”. Cause to add a text string to a number, JavaScript also takes the number as a string.

There are 5 types of primitive data types in JavaScript.

- String.
- Number - Sets mathematical or numeric values.
- Undefined - Sets the Undefined value.
- Boolean - sets values ​​using only two values, "true" and "false".
- Null - sets the value to zero or null.

05. JavaScript Function.

JavaScript codes does a function contain, which are usually activated or worked by an event or a function call. The function of JavaScript is a type of object. Functions can be returned from functions in JavaScript. A JavaScript function can be stored in a variable, another function can be used as an argument for one function.

Example of Basic Function:

function myFunction(parameterOne, parameterTwo, parameterThree) {
// Here your code!
}

06. What is JavaScript Objects ?

JavaScript is an object based web programming language. Almost Everything in language in JavaScript is an object. The English word “Object” literally means “object”, in JavaScript Object means a special type of data that has properties and methods. All JavaScript objects have their own properties and methods. In JavaScript we can create objects and variable types as required. Programming is done using the properties and methods of the JavaScript object.
There are two type of object in JavaScript.
-
Built-in object
- User defined object.

07. JavaScript Array method.

Array can be used to hold more than one value in a variable and we can have any type of value. An array is a special type of JavaScript variable that can capture the same type of information or data used in a single task through a single JavaScript variable. In this case these array objects can be accessed through their subscript. The position of the first element of the array is 0, the position of the element of the element is 1, the position of the third element is 2.
For example
, if we can declare the name of some product as a single variable. But if the number of our products is 200, it will be very difficult to determine in this way. The correct solution is to use arrays. Or we can use arrays to find specific products from 200 products.

08. JavaScript String.

JavaScript string is an object used to modify or manipulate a text. JavaScript’s string object 2 is used to modify or manipulate other text.

There are two ways to create JavaScript strings.
1. Using string literal
2. And Using string objects.

See the syntax for creating a JavaScript string using string literal and using string object.
var stringOne=”write string value”;
var stringTwo=new String(“string literal”);

09. JavaScript Number.

By default, JavaScript expresses mathematical numbers in decimal numbers. But using JavaScript’s toString () we can use 2 to 36 based number systems, for example — binary number system 2 based, octal number system 8 based, decimal number system 10 based, hexadecimal number system 16 based and so on.Only one type of number can be used in JavaScript. However, this number can be written using decimals and can also be written without decimals.
Example:
var Auntor = 5;
// is written without decimal.
var Auntor= 5.12 // written with decimal.

10. What is JavaScript Loop ?

When writing a JavaScript program, in some cases you have to use the same code over and over again to do the same thing. The same type of code can be rewritten using JavaScript loops without having to rewrite the base multiple times. For example, we want to find only the even numbers from the numbers from 1 to 100, in this case a condition can be given without typing the same code again so that the even numbers from 1 to 100 can be found. In other words, if you want to do the same thing in a program for a certain period of time, it is better to use JavaScript’s loop statement.

For Create a program using a loop reduces the complexity of JavaScript, as well as the size of a webpage or JavaScript file. There are 4 types of loops in JavaScript.
01. for loop.
02. while loop.
03. do while loop.
04. and finally for in loop.

--

--

AJ Auntor
AJ Auntor

Written by AJ Auntor

Software Engineer (Front End)

No responses yet