Skip to content

Commit 619d5ce

Browse files
update
1 parent 4985572 commit 619d5ce

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// I want without trim method show i want to trim work for string
2+
let myName = "Sujit "
3+
4+
// with trim function
5+
console.log(myName.trim().length) // 5
6+
7+
// abstract method trim and show another key for trim method
8+
String.prototype.trueLength = function(){
9+
console.log(`true length is ${this.trim().length}`)
10+
return(`true length is ${this.trim().length}`)
11+
}
12+
13+
myName.trueLength() // true length is 5

0 commit comments

Comments
 (0)