NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

JAVA SCRIPT

STRING

string are immutable language- here immutable means if you change any thing in the string that means its make a new string

let str=" aryan verma"

METHOD IN STRING
there are some method in string in string we use as per our requirement

let str="aryan verma";


1.TRIM();

console.log(str.trim());

trim()- the function trim() is use for remove a space in the string .
replace();


2.SLICE();

slice()-the means of slice is katna its make other str of the cutting element

str.slice(2,5)= ans is [yan]
str.slice(2)= ans is [yan verma]


3.TOUPPERCASE();

.4TOLOWERCASE();

.5TOREPLACE();

6.INDEXOF();



ARRAY DATA STRUCTURE

let array= [" aryan", " verma" ];
let array= [" aryan", " verma" , 1,2 ] ; this only happen in java script ( take different typr of data type);

Array are muttable- here muttable means if you change anythink in the array then its change in the main array

4 function use in array

1. POP(); - remove from last
2.PUSH(); - add in last
3.UNSHIFT(); - add in first space
4. SHIFT(); - remove from first

SOME ARRAY METHOD

1. Array.sort(); - this method sort the array in string ( also in case of number it sort in string form);
2. Array.indexOf( " name" ); - remains that o is capital
3. Array.includes( " name"); - answer in true or false
4.Array.slice() - first the meaning of slice is ( katna in hindi) .

slice(2) - it cover all the element after two
slice(2,3)- it cover 2 only
slice(-2)- remove two element at last

5. Array.concat(array2); - add two array
6. Array.reverse();
7. Array.splice()- its all work same like the slice but its change in the main array but slice does not interfare with your orginal array.
splice(1,2) -select first index element and remove 2 element;
splice(1,2," heelo", " hi")- select first index element and remove 2 element and add heelo and hi;

these are different for slice();



Array reference

if you make an array then remeber you store the address of the element in the aray.
eg- let arr1=[1,2,3]
let arr2=[1,2,3]

arr1==arr2; - false
arr1===arr2 - false

let arr1=arr2;

arr1==arr2; - true
arr1===arr2; -true


NESTED ARRAY

let arr1=[ [ 2,3] , [ 4,5] ]

two array in a single array.



OBJECT LITERALS:-

USED TO STORE KEY COLLECTION

property -(key,value);

SYNTAX:-

let student={

name:" aryan",
age:20,
marks:"80"
};
or
let student2={"aryan",20,80};

or

let student3={
name:"aryan";
color: ["blue", "red"];
};

eg:-

const post={
username:"@aryan";
contenet: "this is my #firstpost";
likes:150,
tags:["@aryan"," @bluearmy"]
};

GET VALUE
IF YOU WANT TO GET VALUE

then we call :-
post["likes"] here like is not a key
or
post.content;
post.tags;

**:-here we also change information that store in these object
**:- also we more object in a single one object.



MATH OBJECT

MATHS.PI();
MATHS,ABS();
MATHS.RANDOM();
MATHS.CEIL();
MATHS.FLOOR();

these are the important math function that we use in our regular js.



FUNCTION IN JAVA SCRIPT

function name(){
console.log(" hello");

}


FUNCTION WITH ARGUMENTS

FUNCTION ARGUMNEMT IN JS ARE DIFFERENT AS COMPARE TO JAVA
function name(a1,a2){
console.log(a1,a2);
}

CALLING OF A FUNCTION
name(aryan, verma); // define our function


     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.