The browser storage localStorage is not available. Either your browser does not support it or you have disabled it or the maximum memory size is exceeded. Without localStorage your solutions will not be stored.

String: replace()

The replace method replaces a substring with another:
var str = 'JavaScript';
var newstr = str.replace('Java', 'ECMA');
'Java' is replaced with 'ECMA'. Thus newstr has the value 'ECMAScript'. The original string remains unchanged. Only the first occurrence is replaced:
var newstr = 'Dada'.replace('a', 'i');
newstr has the value 'Dida' and not 'Didi'.

Exercise

Write a function normalize, that replaces '-' with '/' in a date string. normalize('20-05-2017') should return '20/05/2017'.