Skip to content

Commit 019939b

Browse files
authored
Update article.md
1 parent 017aade commit 019939b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

9-regular-expressions/17-regexp-methods/article.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,17 +230,17 @@ Usando una función nos da todo el poder del reemplazo, porque obtiene toda la i
230230

231231
## str.replaceAll(str|regexp, str|func)
232232

233-
This method is essentially the same as `str.replace`, with two major differences:
233+
Este método es escencialmente el mismo que `str.replace`, con dos diferencias principales:
234234

235-
1. If the first argument is a string, it replaces *all occurences* of the string, while `replace` replaces only the *first occurence*.
236-
2. If the first argument is a regular expression without the `g` flag, there'll be an error. With `g` flag, it works the same as `replace`.
235+
1. Si el primer argumento es un string, reemplaza *todas las ocurrencias* del string, mientras qye `replace` solamente reemplaza la *primera ocurrencia*.
236+
2. Si el primer argumento es una expresión regular sin la bandera `g`, funciona igual que `replace`.
237237

238-
The main use case for `replaceAll` is replacing all occurences of a string.
238+
El caso de uso principal para `replaceAll` es el reemplazo de todas las ocurrencias de un string.
239239

240-
Like this:
240+
Como esto:
241241

242242
```js run
243-
// replace all dashes by a colon
243+
// reemplaza todos los guiones por dos puntos
244244
alert('12-34-56'.replaceAll("-", ":")) // 12:34:56
245245
```
246246

0 commit comments

Comments
 (0)