[core][js] small code cleaning