JSFiddle - React, Tailwind, and code Playground
by Msk_Satheesh
JavaScript
//string functions
//toUpperCase()
//toLowerCase()
//charAt()
//split()
//concat()
//includes()
//startsWith
//endsWith
//length
//substring
//replace
//replaceAll
//padEnd
//padStart
//templateLiteral ``
//toString()
const a = 'satheesh'; //lowerCase
console.log(a.toUpperCase());
const b = 'SATHEESH'; //upperCase
console.log(a.toLowerCase());
console.log(b.charAt(3))
const c = 'Welcome_to_India';
console.log(c.split('_'));
const d = a.concat(b);
console.log(a, b, d);
const e = 'Satheesh having teA';
console.log(e.includes('ieg'));
console.log(e.startsWith('Satheesh'));
console.log(e.toLowerCase().endsWith('a'));
console.log(e.length);
console.log(a.split(''));
//substring(startIndex, endIndex)
console.log(e.substring(4,8));
console.log(e.toLowerCase().indexOf('tea'));
const s = 'switch off, turn off';
console.log(s.replace('off', 'on'));
console.log(s.replaceAll('off', 'on'));
const mobileNumber = '8667345724';
//padStart(targetLength, word);
console.log(mobileNumber.padStart(13, '+'));
console.log(mobileNumber.padEnd(13, '+'));
const f = a + ' is awesome';
console.log(f);
const g = `${a} is awesome`;
console.log(g);
const h = 10;
const i = '10';
console.log(h.toString());
console.log(h === i);
console.log(h.toString() === i.toString());