DEV Community

Siddharth Kanojiya
Siddharth Kanojiya

Posted on

JavaScript String Methods | JavaScript #12

// let name = "Sage"
// console.log(name.length)

// escape sequence Character will be counted as per alphabat
// other escape sequence Character are as follow
// \n --> Newline
// \t --> Tab
// \r --> Carring Return

// console.log(name.toUpperCase())
// console.log(name.toLowerCase())

// Index (Rember Index counting will start from 0)

// console.log(name.slice(2, 4))
// console.log(name.slice(2,))

// if you give only 1 argument in slice method than from 1st argument it will go till the end

// Replace Method will replace the alphabat or paticular word from it place and put another one

// console.log(name.replace("age","vsk"))
// let friend = "Shiv"
// console.log(name.concat(" is a friend of ",friend, " ok"))

// let friend2 = " Hanuman "
// console.log(friend2.trim())

let name = "John"
for(let i=0; i<(name.length); i++) {
console.log(name[i]
}

Top comments (4)

Collapse
 
codecraftjs profile image
Code Craft-Fun with Javascript •

Nice! Keep it up.

As a beginner, a programmer should understand how a programming language works. I have started the series on core javascript concepts which could help one ace any interview and leverage their proficiency in the language.
I hope you will find it useful. Follow Code Craft Js and share this knowledge with you friends and colleagues.
Happy Coding!

Collapse
 
sksage profile image
Siddharth Kanojiya •

Thank you so much my friend I will definitely check out , I am writing code on replit please check out work and suggest me how i can improve I am leaving link please check out and suggest me what should i do to improve my self

Collapse
 
tinkerbaj profile image
tinkerbaj •

There is many many more but nice start :)

Collapse
 
goku_91 profile image
Si •

excellent work