From a78cb16a9859cc583162763f54b6fd249f10ccfa Mon Sep 17 00:00:00 2001 From: Shadab <38731117+shady54@users.noreply.github.com> Date: Wed, 19 Jul 2023 15:34:49 +0530 Subject: [PATCH] Update 02_day_data_types.md substr() method deprecated per main ECMAScript specification. Request to update a note for the same in .md file --- 02_Day_Data_types/02_day_data_types.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/02_Day_Data_types/02_day_data_types.md b/02_Day_Data_types/02_day_data_types.md index e27d43d..2caa901 100644 --- a/02_Day_Data_types/02_day_data_types.md +++ b/02_Day_Data_types/02_day_data_types.md @@ -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.