convert to javascript