0% found this document useful (0 votes)
2 views2 pages

Javascript Methods Guide

The document provides a comprehensive overview of commonly used JavaScript methods, categorized into String, Array, Object, Math, JSON, and Modern JavaScript methods. Each method is accompanied by its syntax and examples for clarity. It also highlights the most important methods relevant for job applications, particularly in Array and String categories, as well as async JavaScript techniques.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Javascript Methods Guide

The document provides a comprehensive overview of commonly used JavaScript methods, categorized into String, Array, Object, Math, JSON, and Modern JavaScript methods. Each method is accompanied by its syntax and examples for clarity. It also highlights the most important methods relevant for job applications, particularly in Array and String categories, as well as async JavaScript techniques.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Most Used JavaScript Methods – Syntax and Examples

String Methods

Method Example / Syntax

includes() [Link](value)<br/><br/>Example:<br/>"Hello".includes("He") // true

toUpperCase() "hello".toUpperCase() // HELLO

slice() "JavaScript".slice(0,4) // Java

replace() "Hello World".replace("World","JS") // Hello JS

split() "a,b,c".split(",") // ["a","b","c"]

trim() " Dishant ".trim() // Dishant

Array Methods

Method Example / Syntax

push() [Link](5)

pop() [Link]()

map() [1,2,3].map(num => num * 2) // [2,4,6]

filter() [1,2,3,4].filter(num => num % 2 === 0) // [2,4]

find() [1,2,3].find(num => num > 1) // 2

findIndex() [1,2,3].findIndex(num => num === 2) // 1

reduce() [1,2,3].reduce((sum,n)=>sum+n,0) // 6

forEach() [Link](item => [Link](item))

some() [1,2,3].some(n => n > 2) // true

every() [1,2,3].every(n => n > 0) // true

sort() [3,1,2].sort((a,b)=>a-b) // [1,2,3]

join() ["a","b"].join("-") // a-b

Object Methods
Method Example / Syntax

[Link]() [Link](user)

[Link]() [Link](user)

[Link]() [Link](user)

hasOwnProperty() [Link]("name")

Math Methods

Method Example / Syntax

[Link]() [Link]()

[Link]() [Link](4.9) // 4

[Link]() [Link](4.1) // 5

[Link]() [Link](1,5,10) // 10

JSON Methods

Method Example / Syntax

[Link]() [Link](user)

[Link]() [Link](jsonString)

Modern JavaScript

Method Example / Syntax

Optional Chaining [Link]?.city

Nullish Coalescing username ?? "Guest"

Most Important Methods for Jobs


Array Methods: map(), filter(), reduce(), find(), forEach()
String Methods: includes(), split(), replace(), trim()
Object Methods: [Link](), [Link]()
Async JS: fetch(), Promise, async/await

You might also like