fork download
  1. // your code goes here
  2. var swap = (function (name_a, name_b){
  3. return function swp(){
  4. let t = eval(name_a);
  5. t_name = Object.keys({t})[0]
  6. eval(name_a + " = " + name_b)
  7. eval(name_b + " = " + t_name)
  8. }})()
  9. var x=4
  10. var y=7
  11. swap(Object.keys({x})[0],Object.keys({y})[0])
  12. console.log(x)
  13. console.log(y)
  14. console.log("doesnt work")
Success #stdin #stdout 0.02s 16860KB
stdin
Standard input is empty
stdout
4
7
doesnt work