updated code examples to javascript formatting