About 1,430,000 results
Open links in new tab
  1. How do you replace an Object value in Javascript?

    Aug 21, 2017 · Here's the question: Create a function called changeEmail that takes in a user object and a newEmail string. Replace the user's current email address (assigned to the email …

  2. JavaScript String replace() Method - W3Schools

    The replace() method searches a string for a value or a regular expression. The replace() method returns a new string with the value(s) replaced. The replace() method does not change the …

  3. String.prototype.replace() - JavaScript | MDN - MDN Web Docs

    Apr 28, 2025 · The replace() method of String values returns a new string with one, some, or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and …

  4. JavaScript: String replace() method - TechOnTheNet

    In JavaScript, replace() is a string method that is used to replace occurrences of a specified string or regular expression with a replacement string. Because the replace() method is a method of …

  5. JavaScript Replace – How to Replace a String or Substring in JS

    Feb 28, 2023 · In JavaScript, you can use the replace() method to replace a string or substring in a string. The replace() method returns a new string with the replacement. The replace() …

  6. JavaScript string replace () Method - GeeksforGeeks

    Jun 26, 2024 · JavaScript replace () method is used for manipulating strings. It allows you to search for a specific part of a string, called a substring, and then replace it with another …

  7. Replace string value with javascript object - Stack Overflow

    Jan 11, 2016 · String.prototype.replaceByObject = function(obj) { return this.replace(RegExp(Object.keys(obj).join('|'), 'g'), function(val) { return obj[val]; }); } use it like …

  8. JavaScript replace () Method: String Object - w3resource

    Aug 19, 2022 · The replace method is used to find a match between a regular expression and a string, and replaces the matched substring with a new substring.

  9. JavaScript String Methods - W3Schools

    The replace() method does not change the string it is called on. The replace() method returns a new string. The replace() method replaces only the first match. If you want to replace all …

  10. Using replace() and replaceAll() in JavaScript - DEV Community

    Oct 17, 2021 · In this tutorial, we're going to see how to use the methods replace() and replaceAll() in javascript. Both methods are part of the String object. that means you can …

  11. Some results have been removed