Write a method to replace all spaces in a string with '%20' javascript without regex code example Example: javascript string spaces replace with %20 string.replace()