encodeEncode characters that need to be encoded on the path, search and hash sections of the URL. function encode(text: string | number): string;§encode(text: string | number): string[src]§Parameters§text: string | number[src] string to encode §Return Type§string[src]encoded string