History of JS & Fundaments of JS

History of JS & Fundaments of JS

#HISTORY

The 1st name of JS is Mocha and after that, the name is change to LiveScript in 1995, and again its name changed to JavaScript in 1996, and this name we are using till date.

so when this scripting will come into the market that time there will be two browsers available in the market Netscape (web browser) and Internet Explorer ,these two browsers are there in the market at that time.

So at that time, both browsers are decided to make or set common rules to develop a website and ECMAScript comes into the picture , till date it time to time getting updates and now we are using its version of ES6. So this is the finest standard till date which comes in 2015 and still, this is there in the market.

#BASICS

As learning any of the languages, we have some basics or we can say some fundamentals things of every language through which we suppose to go through first or also we can say this as the pilers of the languages on which all the core concepts are based. So now we can see there fundamentals of JS.

  1. Valuers

  2. Operations

  3. Variables

  4. Decisions

  5. Loops

  6. Functions

So these are some fundaments of js we will see all one by one.

#Data Types

1) Values --> So values are nothing but the numbers it might be floating to decimal as you say or an integer all the numbers are treated in JS as values.

let a=3
let b=3.5
let c=3.4444

As you sew the above example all the numbers will be coming in the values of js

2) String --> It is simpler than you might learn in any of the programming languages the combination of two or more characters will be a string

for example:

"manish"

'manish'

these both are treated as stings in JS.

3) Boolean values --> The Boolean concept basically discovered by Jorj Bully so it's basically tells us about the true or false of a condition.

for example

a=2; consol.log(a!=2*)*

so basically the above example o/p will be printed as FALSE and here this is because of a is 2 and we are checking a is not equal to 2 but a is 2 only that's way it returns false.

here false means we can say that 0 and True means 1.

3) null / undefine ->> this simply means they are empty or empty values actually they don't hold any kind of values inside them.

suppose a=3; then we can say that a has value 3 and if a=null; now we can say that a dont have any value.

BASICALLY ALL WE DISCSSED ARE PRIMITIVES VALUES OR DATA TYPES

NEXT WE HAVE ARREY AND OBJECT

array

so in simple in JS whenever you can see two square brackets [ ], are nothing but a array and also it contains any kind of datatypes which we discussed previously

ex: [a , 'manish' , true] --> this is nothing but an array,

so lets discuss about indexing of the array values

if [ a , " manish " , ' kumar' , false ] index ..0......1...................2.............3.....

so here a is on index 0 and manish is on 1 like that the index concept will be in js.

objects

here in js objects are create using double curly breces " { } " .

for example

{
fname:manish, lname:kuma, key:values

}

here in objects every data or values are in the forms of key and values and in the above example as we saw fname, and lname will be or key and the manish , and kumar are the values assign to the keys so basically the concept will be quit similar to arrays but the biggest difference is her ewe can access the values with the help of keys and in array via index.

so the above both the examples will be non primitive

Now all the values we need to store somewhere to use it Then the variables concept comes.

Variables are nothing but place holder for values

so in JS we have 3 ways in which we are declaring a variable

  1. let

  2. var

  3. const

var and let are both used for variable declaration in javascript but the difference between them is that var is function scoped and let is block scoped. Variable declared by let cannot be redeclared and must be declared before use whereas variables declared with var keyword are hoisted.

An example will clarify the difference even better :

<script>
    console.log(x);
    var x=5;
    console.log(x);
</script>
output _>
undefined
5

Example 2: Here we will see the use of let.

<script>
    console.log(x);
    let x=5;
    console.log(x);
</script>
output_>
ReferenceError: Cannot access 'x' before initialization

and for const we can say that something which we can't change once we declar

suppose we assign " const a = 4;

then we cant able to change it further.

Template laterals

age=3
consol.log(`my age is ${age}`)

output is :

my age is 3

so we are using this concept to write a other datatypes with another and for that we are using back tick (``) to write the value we are using ${ value }

operators in js

  1. Arithmetic operators: perform mathematical operations on numbers, such as addition (+), subtraction (-), multiplication (*), and division (/).

  2. Comparison operators: compare values and return a boolean value (true or false), such as equal to (==), not equal to (!=), greater than (>), less than (<), and more.

  3. Logical operators: perform logical operations, such as AND (&&), OR (||), and NOT (!).

  4. Assignment operators: assign a value to a variable, such as =, +=, and -=.

  5. Conditional (ternary) operator: a shorthand way of writing an if-else statement, using the syntax: condition ? value1 : value2.

thanks for reading give your valuable feedback and any error will be there please inform me .