update js representation