Javascript - Global escape() Function

The escape() function was deprecated in JavaScript version 1.5. Use encodeURI() or encodeURIComponent() instead.

Description

The escape() function was deprecated in JavaScript version 1.5. Use encodeURI() or encodeURIComponent() instead.

The escape() function encodes a string.

Syntax

escape(string)

Parameter Values

Parameter Require Description
stringRequired. The string to be encoded

Return

A String, representing the encoded string

Example

Encode a string:

Demo

console.log(escape("Need tips? this !@#$%^&*()!"));

Result