to string method javascript code example Example 1: js string String(thing) Example 2: js string return 'cat'.charAt(1); // returns "a"