Hi,
In the code, releaseNotes is being split by a regular expression, and the second part (index [1]) is being assigned back to releaseNotes. If the split operation does not result in at least two elements (meaning the regular expression did not match anything), releaseNotes will be undefined, and trying to call replace on it will throw the error.
Bug fixing: Check if releaseNotes is undefined after the split operation
What if the releaseNotes and notes won't be split by a regular expression? What to return in this case?
Hi, In the code, releaseNotes is being split by a regular expression, and the second part (index [1]) is being assigned back to releaseNotes. If the split operation does not result in at least two elements (meaning the regular expression did not match anything), releaseNotes will be undefined, and trying to call replace on it will throw the error.
Bug fixing: Check if releaseNotes is undefined after the split operation What if the releaseNotes and notes won't be split by a regular expression? What to return in this case?