Update 02_day_data_types.md

substr() method deprecated per main ECMAScript specification.
Request to update a note for the same in .md file
pull/818/head
Shadab 2 years ago committed by GitHub
parent 55d8e3dbc0
commit a78cb16a98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -513,6 +513,9 @@ console.log(string.substr(4,6)) // Script
let country = 'Finland'
console.log(country.substr(3, 4)) // land
```
**Note**: `substr()` method has been deprecated and not part of main ECMAScript specification. Use of `substring()` and `slice()` methods are advised for cross-platform support.
Reference : [MDN susbtr()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr )
6. *substring()*: It takes two arguments, the starting index and the stopping index but it doesn't include the character at the stopping index.

Loading…
Cancel
Save