Skip to content

Commit

Permalink
How to add method to String class in JavaScript.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamabhiCH committed Mar 24, 2024
1 parent 33444f4 commit 1b5f7ce
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions str_length.js
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 1b5f7ce

Please sign in to comment.