mapping Erlang/OTP and JavaScript