Formatted code to javascript code convention