---
title: "Discussion on \"replaceAll in JavaScript\" | Hashnode"
description: "Discussion on \"replaceAll in JavaScript\". String.prototype.replaceAll() replaces all occurrence of a string with another string value.\n\nSyntax:\nconst newStr = str.replaceAll(regexp|substr, newSubstr|function)\n\nThere are few ways to replace all occurrence of a string:\n\nRegEx\nsplit and join\nre..."
url: "https://hashnode.com/posts/replaceall-in-javascript/5ffa8613a538d0013515536b"
---

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

Discussion

# [replaceAll in JavaScript](https://suprabhasupi.hashnode.dev/replaceall-in-javascript?utm_source=hashnode&utm_medium=feed)

String.prototype.replaceAll() replaces all occurrence of a string with another string value. Syntax: const newStr = str.replaceAll(regexp|substr, newSubstr|function) There are few ways to replace all occurrence of a string: RegEx split and join re...

Jan 10, 2021 · 2 min read · suprabhasupi.hashnode.dev  
Updated Jul 17, 2021  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#reactjs](https://hashnode.com/tag/reactjs)

## Written by

[Suprabha Supi](https://hashnode.com/@suprabhasupi)

@suprabhasupi · Bengaluru, India

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

🔥 New JS, CSS, HTML articles every week 🔥

I am Senior Frontend Engineer and post daily tips about Web Dev My goal is to encourage more people to get into tech.

## Responses 1

Markdown supported · ⌘↵ to post

[Jason Shrumm](https://hashnode.com/@Shrumm)

[Jun 16, 2021](https://hashnode.com/posts/replaceall-in-javascript/5ffa8613a538d0013515536b/comment/60c99a4880c5541363dd3204)

Thanks, I like the manner of concise writing and shortness in your expanation. I would like to sync your article to the Programiz blog and add as a JavaScript String Replace() guide explained by custom examples.

How to do my assignment in Java [https://essaydune.com/do-my-assignment/](https://essaydune.com/do-my-assignment/)

[Suprabha Supi](https://hashnode.com/@suprabhasupi)

[Jun 17, 2021](https://hashnode.com/posts/replaceall-in-javascript/5ffa8613a538d0013515536b/comment/60c99a4880c5541363dd3204#reply-60cad35e8ce4491f0f297cd5)

Hey Jason,

Yes sure. You can definitely sync this article. ☺️
