TP1 javascript function adder