String.prototype.replace All

GPTKB entity

Statements (22)
Predicate Object
gptkbp:instance_of gptkb:Mathematics
gptkbp:case_sensitive Yes, it is case-sensitive.
gptkbp:chaining Can be chained with other string methods.
gptkbp:color_scheme String or Reg Exp
gptkbp:compatibility Supported in modern browsers and Node.js.
gptkbp:data_return gptkb:string_theory
gptkbp:description Returns a new string with all matches of a pattern replaced by a replacement.
gptkbp:error_handling Throws a Type Error if search Value is null or undefined.
gptkbp:example 'hello world'.replace All('world', 'there') returns 'hello there'.
gptkbp:formulation replace All(search Value, replace Value)
https://www.w3.org/2000/01/rdf-schema#label String.prototype.replace All
gptkbp:introduced_in ECMAScript 2021 (ES12)
gptkbp:is_opposed_by Use replace with a global regex for older environments.
gptkbp:non_destructive Does not modify the original string.
gptkbp:orbital_period replace Value
search Value
gptkbp:performance More efficient than using replace with a global regex.
gptkbp:related_method gptkb:String.prototype.replace
gptkbp:type String method
gptkbp:usage Used to replace all occurrences of a substring.
gptkbp:bfsParent gptkb:Spider-Man
gptkbp:bfsLayer 4