JavaScript Deprecated list
Sankalpcreat
Posted on June 16, 2023
As we know how javascript is evolving day by day new library are coming every year but mostly 3 library/framework are dominating the dev community. React ,Vue , Angular Javascript most popular libraries/framework. Deprecation typically occurs for various reasons, such as improving language consistency, enhancing performance, or addressing security concerns. When a feature is deprecated, it means that it is still available for use, but developers are encouraged to migrate to the recommended alternatives to ensure compatibility with future versions of the language.
1-Deprecated String functions: The String.prototype.anchor(), String.prototype.big(), String.prototype.blink(), String.prototype.small(), String.prototype.strike(), and String.prototype.sup() methods are deprecated
2-Deprecated Function properties:The Function.prototype.arguments and Function.prototype.caller properties are deprecated
3-Deprecated Function constructor:Using eval() with untrusted code can lead to code injection vulnerabilities.
4-Deprecated escape() and unescape() functions: recommended to use encodeURI(), encodeURIComponent(), decodeURI(), and **decodeURIComponent() **functions instead.
eval() Function:
//Previous
eval('console.log("Hello, World!")');
//New way
console.log("Hello, World!");
Function Constructor:
//Previous
var multiply = new Function('a', 'b', 'return a * b;');
//Modern way
var multiply = (a, b) => a * b;
Posted on June 16, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.