input: 
  def translate_code(code: str, source_language: str, target_language: str) -> str:
      """ This function translates the given code from the source programming language 
      to the target programming language. The input code should be provided as a string.
      >>> translate_code("let arr = [1, 2, 3, 4, 5];\narr.forEach(item => { console.log(item * 2); });", "JavaScript", "Python")
      "arr = [1, 2, 3, 4, 5]\nfor item in arr:\n print(item * 2)"
      >>> translate_code("arr = [1, 2, 3, 4, 5]\nfor item in arr:\n print(item * 2)", "Python", "JavaScript")
      "let arr = [1, 2, 3, 4, 5];\narr.forEach(item => { console.log(item * 2); });"
      """
  
output:     if source_language == "JavaScript" and target_language == "Python":
          code = code.replace("let ", "")
          code = code.replace(";", "")
          code = code.replace("arr.forEach(item => { console.log(item * 2); });", "for item in arr:\n print(item * 2)")
          return code
      elif source_language == "Python" and target_language == "JavaScript":
          code = code.replace("arr = ", "let arr = ")
          code = code.replace("for item in arr:", "arr.forEach(item => {")
          code = code.replace("print(item * 2)", "console.log(item * 2); });")
          return code
      else:
          return code