OneCompiler

JavaScript string basics

125

/**string is a refernce datatype ie, it stores the address of data,
in js strings are mutable. /

//creating a string
var string = "devuuzzz";

//to find length of string
console.log("the length is ",string.length)

//to print each letter of string
for(var i=0; i<string.length; i++){
console.log(string[i])
}

//to access any charater in a string
...****