From 1b5f7ce932b1644fa89e57b159aa353eeae4cbc2 Mon Sep 17 00:00:00 2001 From: Abhishek Yadav Date: Sun, 24 Mar 2024 12:43:33 +0530 Subject: [PATCH] How to add method to String class in JavaScript. --- str_length.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 str_length.js diff --git a/str_length.js b/str_length.js new file mode 100644 index 0000000..8e11fb0 --- /dev/null +++ b/str_length.js @@ -0,0 +1,9 @@ +// How to add method to String class in JavaScript + +let str1 = "savukbhsdsha sch dshvbsdhvbasd hs bhsdvbdhb "; +let str2 = "shsdvhsdkahdohuiyrgwiufhw hgewfgruibcbsklksdcnkj ksdjvbsjskjdfdubdjkbavksd"; + +let l1 = str1.length; +let l2 = str2.length; + +console.log(l1+l2); \ No newline at end of file