Update js function snippet.