Trim newlines from the start and/or end of a string
Bytes is a JavaScript newsletter you'll actually enjoy reading.
Delivered every Monday, for free.
Loved by over 200,000 developers