We can write JS code in HTML Document at the end of "body" tag by using a tag or element "script". as shown bellow.
You can use link your JS file by using script tag and src="myscript.js" .
It is the name of the memory location where we store any data.
We can simply make variable by using var and let keyword .
JavaScript comments can be used to explain JavaScript code, and to make it more readable.
This comment lines are not executable by browser.
This comments are two types (i)Single-line and (ii) Multi-line comments.
The const keyword was introduced in ES6 (2015).
Variables defined with const cannot be Redeclared.
Variables defined with const cannot be Reassigned.
Operators are the symbles which performs a specific operation with one or more operands.
operands are these values which are use to performs operations.
Operators are two types Unary and Binary
JavaScript has 8 Datatypes
1. String
2. Number
3. Bigint
4. Boolean
5. Undefined
6. Null
7. Symbol
8. Object
The Object Datatype
The object data type can contain:
1. An object
2. An array
3. A date
To print any thing in terminal you can just use console.log("Hello Every One"); then go to inspect element in your browser and open console and see the output.
A string is a series of characters which use to represent a value.
For more information go to here Click Me.String length: to find the length of any string.
String slice(): extracts a part of a string and returns the extracted part in a new string.
String substring(): The difference is that start and end values less than 0 are treated as 0 .
String substr(): substr() is similar to slice().
The difference is that the second parameter specifies the length of the extracted part.
String replace(): The replace() method replaces a specified value with another value in a string.
String toUpperCase(): string is converted to upper case .
String toLowerCase(): string is converted to lower case with.
String concat(): joins two or more strings.
String trim(): it removes whitespace from both sides of a string.
String charAt(): method returns the character at a specified index (position) in a string.
String split(): A string can be converted to an array with the split() method.
Conditional statements are used to perform different actions based on different conditions.
Use if to specify a block of code to be executed, if a specified condition is true.
Use else to specify a block of code to be executed, if the same condition is false.
Use else if to specify a new condition to test, if the first condition is false.
Use switch to specify many alternative blocks of code to be executed
A Array is a list or collection of some Data Items.
You can assign an array in different types, for more information you can click the note section
link click me
An Object is a type of array which use to store multiple type of data items with a access key.
For more information you can go to a page Click MeA JavaScript function is a block of code designed to perform a particular task.
A JavaScript function is executed when "something" invokes it (calls it).
o Due to Alert in browser Javascript through a pop-up message.
o Due to Prompt you can take user input through browser.
o Confirm is use to take user confirmation through browser.
Loops are handy, if you want to run the same code over and over again, each time with a different value.
There is different kind of loops are avilable, like for, while and do-while.
When a web page is loaded, the browser creates a Document Object Model of the page.
The HTML DOM model is constructed as a tree of Objects:
For more information you can go to a page Click MeWhen an action is happened than the block of code is run.
NOTE: Apply this in our Code Editor.
SetTimeout() : It runs a function after an interval of time.
ClearTimeout() : It stops the function after an interval of time.
SetInterval() : It allows us to run a function repeatedly after every interval of time.
It is a short cut to call a function in Java Script.
NOTE: Apply this in our Code Editor.