title: Is there a simple way in Javascript to encode a string using a dictionary?
body: <p>I want to use a simple substitution code, with (perhaps) a dictionary. In Python, it's straightforward but I want to write it in JavaScript.</p>
  
  <pre><code>dict = {}
  dict["c"]="f"
  dict["u"]="i"
  dict["t"]="j" .... 
  
  for x in message:
      print (dict[x].upper())
  </code></pre>