<?php
function toconv(string)
{
$gogo = array("a" => "b","cd" => "e");
$string = str_replace(
array_keys( $gogo ),
array_values( $gogo ),
$string
);
return $string;
}
?>
How can I implement that in JavaScript?