Javascript

Array methods.

.pop -> removes the last element of the array.
.push(element) → add the element to the end of the array.
.shift() → Removes the first element of the array.
.unshift(element) → Add one element to the beginning.
.toString() → Convert array to string.
.sort() → Sort the array.
.splice() →

String Functions.

.length → Return lenth of the string.
myString.indexOf(“term1”) → Return position of the first instance of the searched term.
myString.lastIndexOf(“term1”) → Return position of the last instance of the searched term.
myString.slice(0,3) → Returns first three characters of the string.
myString.replace(“Mukesh”, “Reena”) → Replace first occurance of the first word with the second.

JavaScript Date Functions.
let myDate = new Date();
.getTime() → Time in seconds.
.getFullYear() → Returns year as 2022
.getDay() → Returns 0 to 6 for Sunday to Saturday.
.getMinutes() → Returns 0 to 59
.getHours() →
.getSeconds() →

document.
document.location → location & details of the document.
document.url
document.title
document.scripts → Returns array of scripts.
document.links → Returns array of links in the document.
document.forms
document.images
document.domain

document.querySelector(“.container”) → Returns first matching container.