---
title: "Discussion on \"JavaScript trim() method\" | Hashnode"
description: "Discussion on \"JavaScript trim() method\". In JavaScript, the trim() method is a built-in method for strings that removes whitespace from both ends of a string. Whitespace includes spaces, tabs, and newlines. The trim() method does not alter the original string; instead, it returns a new stri..."
url: "https://hashnode.com/posts/javascript-trim-method/65aa7c891cb1369157665805"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [JavaScript trim() method](https://xdcoder.hashnode.dev/javascript-trim-method?utm_source=hashnode&utm_medium=feed)

In JavaScript, the trim() method is a built-in method for strings that removes whitespace from both ends of a string. Whitespace includes spaces, tabs, and newlines. The trim() method does not alter the original string; instead, it returns a new stri...

Jan 19, 2024 · 3 min read · xdcoder.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#programming](https://hashnode.com/tag/programming)
-   [#blogging](https://hashnode.com/tag/blogging)
-   [#dailydev](https://hashnode.com/tag/dailydev)
-   [#js](https://hashnode.com/tag/js)

## Written by

[Aditya Sharma](https://hashnode.com/@xdcoder)

@xdcoder · Bengaluru, India

  
[View profile](https://hashnode.com/@xdcoder)

I build things for the web.

I am a web developer from Bengaluru, India. My mission is to turn your vision into a compelling digital experience. I'm here to collaborate and bring your ideas to life. Let's build something amazing together!

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
