As its name indicates, Javascript encodeURIComponent function encodes a URI comopnent into corresponding string value.
The encodeURIComponent function considers special characters like , ? : / @ + = $ # to convert into corresponding string value.
Javascript encodeURIComponent function accept string parameter and return corresponding encoded string value.
Syntax