Closed jaller94 closed 5 years ago
If pattern is a string, only the first occurrence will be replaced. The section header "Type of Object" currently becomes "Typeof Object".
pattern
I assume you wanted to remove all spaces. A regular expression can help because it has the global flag g. This matches every space:
g
/ /g
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace The deprecation warning for flags refers to an unofficial third parameter, not pure regular expressions.
flags
Good change, while that is "technically correct" because it's all integrated in a known way I wasn't too worried about it.
If
pattern
is a string, only the first occurrence will be replaced. The section header "Type of Object" currently becomes "Typeof Object".I assume you wanted to remove all spaces. A regular expression can help because it has the global flag
g
. This matches every space:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace The deprecation warning for
flags
refers to an unofficial third parameter, not pure regular expressions.