var str = "Hello World!"; var n = str.length;
Example : 2 Finding Number of Characters in a String
let sentence = ""; let len = sentence.length; console.log(len); // 0 sentence = "I love Pakainfo."; len = sentence.length; console.log(len); // 17 sentence.length = 5; console.log(sentence); // I love Pakainfo.
Example : 3
var members = ["Radhubhi", "OsmanMeer", "Brijubarot", "Gordhanmenu"]; var membersLength=members.length;//4 is members array length var str = "bug"; var strLength=str.length;//3 is the number of characters in bug
let SomeString = "Example"; console.log(SomeString.length)
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.