Create a new instance of TextEncoder with utf-8 encoding.
Encodes a string as Uint8Array. utf-8 by default.
Encodes and saves the value
into the result
array.
Returns the name of this object's type.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other
. Useful for checking if two references point to the same thing.
Contains methods for Text encoding
Example
js var encoder = new TextEncoder() let originalStr = "\u223e\u0020\u0045\u22c5\u0064\u0061\u0020\u003d\u0020\u0051" let encodedArr = encoder.encode(originalStr) print("encodedArr="+encodedArr) // result is [226,136,190,32,69,226,139,133,100,97]