I tried following the documentation on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace, but I could't figure out what is the below code is doing.
I know it is doing a replace with RegExp, but can't figure out what is being replaced.
str.replace(/(^\s*)|(\s*$)/gi,"")
Thanks.