85% Discount for all November
Software Development
JavaScript
Coding
Front end
Hey Folks, this blog is all about basic commands of Javascript. Before proceeding further, I suggest you have some knowledge about ‘What is Javascript?’ and ‘What role does javascript play in Web development?’. Let’s begin our journey with our first topic:
A value is a piece of data, so it’s the most fundamental unit of information that we have in programming. This text “Jonas” is a value. To see this value in the console, we need to log this value into the console using console.log( ). For example, console.log (“Jonas”);
We can store values into variables by using let. For example: let firstName = “Jonas”; here, we assign a value “Jonas” into a variable named firstName. To see the value of this variable, we log this variable into the console. For example: console.log ( firstName );
A variable name cannot start with a number and uppercase letter. Variable only contain numbers, letters, underscore (_), or the dollar ($) sign. For example: let first_Name = “Jonas”; or let name1 = “Jonas”;
There are seven primitive data types in Javascript.
Number: Floating point numbers are used for decimals and integers. For example: let age = 23;
String: Sequence of characters used for text. For example: let firstName = “Jonas”;
Boolean: Logical type that can only be true or false when used for making decisions. For example: let fullAge = true;
Undefined: Value has been taken by a variable that is not yet defined (‘empty value’). For example: let children;
Null: It also means ‘empty value.’
Symbol: Value that is unique and cannot be changed.
BigInt: Larger integers than the Number type can hold.
An operator allows us to transform or combine multiple values and do all kinds of work with matters.
1.Arithmetic Operators: Arithmetic operators are used to perform arithmetic on numbers.
2.Assignment Operators: Assignment operators assign values to Javascript variables.
3. Comparison Operators: Comparison operators are used in logical statements to determine equality or difference between variables or values.
4. Logical Operators: Logical operators determine the logic between variables or values.
5.Type Operator: Returns the type of a variable.
6. Bitwise Operator: Bit operators work on 32 bits numbers. Any numeric operand in operation is converted into a 32-bit number. The result is converted back to a Javascript number.
This was all about the basic commands of JavaScript.
JavaScript is a powerful programming language that enables you to create complex applications for the web. It's one of the most popular languages among developers, and it's used by some of the biggest companies in the world, including Archi's Academy, Facebook, and Amazon.
Meet you in the next blog, have a productive day!
Wednesday, Apr 6, 2022