代码][JavaScript]代码 1(int).toString(16); // converts int to hex, eg 12 => "C" 2(int).toString(8); // converts int to octal, eg. 12 => "14" 3parseInt(string,16) // converts hex to int, eg. "FF" => 255 4parseInt(string,8) // converts octal to int, eg. "20" => 16