mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-10 09:05:55 -05:00
chore(i18n,learn): processed translations (#50181)
This commit is contained in:
@@ -10,7 +10,7 @@ dashedName: target-the-parent-of-an-element-using-jquery
|
||||
|
||||
Ogni elemento HTML ha un elemento `parent` (genitore) dal quale eredita (`inherits`) delle proprietà.
|
||||
|
||||
For example, the `h3` element in your `jQuery Playground` has the parent element of `<div class="container-fluid">`, which itself has the parent element of `body`.
|
||||
Ad esempio, l'elemento `h3` in `jQuery Playground` ha come elemento genitore `<div class="container-fluid">`, che a sua volta ha come elemento genitore `body`.
|
||||
|
||||
jQuery ha una funzione chiamata `parent()` che consente di accedere al genitore di qualsiasi elemento selezionato.
|
||||
|
||||
|
||||
@@ -7,25 +7,25 @@ dashedName: step-11
|
||||
|
||||
# --description--
|
||||
|
||||
Before you start creating additional regular expressions, you need to update your application to check more than one regular expression.
|
||||
Prima di iniziare a creare altre espressioni regolari, devi aggiornare l'applicazione per verificare più di un'espressione regolare.
|
||||
|
||||
Start by declaring a `denyList` variable. Assign it an array containing your `helpRegex`.
|
||||
Inizia dichiarando una variabile `denyList`. Assegnale un array contenente `helpRegex`.
|
||||
|
||||
# --hints--
|
||||
|
||||
You should use `const` to declare a `denyList` variable.
|
||||
Dovresti usare `const` per dichiarare la variabile `denyList`.
|
||||
|
||||
```js
|
||||
assert.match(code, /const\s*denyList\s*=/);
|
||||
```
|
||||
|
||||
Your `denyList` variable should be an array.
|
||||
La variabile `denyList` dovrebbe essere un array.
|
||||
|
||||
```js
|
||||
assert.isArray(denyList);
|
||||
```
|
||||
|
||||
Your `denyList` array should have `helpRegex` as its only element.
|
||||
L'array `denyList` dovrebbe avere `helpRegex` come unico elemento.
|
||||
|
||||
```js
|
||||
assert.deepEqual(denyList, [helpRegex]);
|
||||
|
||||
@@ -7,31 +7,31 @@ dashedName: step-12
|
||||
|
||||
# --description--
|
||||
|
||||
Remember that arrays have a `.some()` method. Use the `.some()` method to check if testing your `msg` on any of your `denyList` regular expressions returns `true`.
|
||||
Ricorda che gli array hanno un metodo `.some()`. Usa il metodo `.some()` per controllare se testare `msg` o una qualsiasi delle espressioni regolari di `denyList` restituisce `true`.
|
||||
|
||||
Use `regex` as the parameter for the callback function, for clarity.
|
||||
Usa `regex` come parametro per la funzione callback, per chiarezza.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `isSpam` function should implicitly return the result of `denyList.some()`.
|
||||
La funzione `isSpam` dovrebbe restituire implicitamente il risultato di `denyList.some()`.
|
||||
|
||||
```js
|
||||
assert.match(code, /const\s*isSpam\s*=\s*\(?\s*msg\s*\)?\s*=>\s*/)
|
||||
```
|
||||
|
||||
Your `.some()` method should use arrow syntax for the callback.
|
||||
Il metodo `.some()` dovrebbe usare la sintassi freccia per la callback.
|
||||
|
||||
```js
|
||||
assert.match(code, /const\s*isSpam\s*=\s*\(?\s*msg\s*\)?\s*=>\s*denyList\.some\(\s*\(?.*\)?\s*=>/);
|
||||
```
|
||||
|
||||
Your `.some()` callback should take `regex` as the parameter.
|
||||
La callback di `.some()` dovrebbe prendere `regex` come parametro.
|
||||
|
||||
```js
|
||||
assert.match(code, /const\s*isSpam\s*=\s*\(?\s*msg\s*\)?\s*=>\s*denyList\.some\(\s*\(?\s*regex\s*\)?\s*=>/);
|
||||
```
|
||||
|
||||
Your `.some()` callback should implicitly return the result of testing `msg` on `regex`.
|
||||
La callback di `.some()` dovrebbe restituire implicitamente il risultato del test di `msg` su `regex`.
|
||||
|
||||
```js
|
||||
assert.match(code, /const\s*isSpam\s*=\s*\(?\s*msg\s*\)?\s*=>\s*denyList\.some\(\s*\(?\s*regex\s*\)?\s*=>\s*regex\.test\(\s*msg\s*\)\s*\)/);
|
||||
|
||||
@@ -7,31 +7,31 @@ dashedName: step-13
|
||||
|
||||
# --description--
|
||||
|
||||
The next regular expression you will work on is one that matches mentions of dollar amounts.
|
||||
La prossima espressione regolare su cui lavorerai è quella che trova corrispondenza con somme di denaro in dollari.
|
||||
|
||||
Start by declaring a `dollarRegex` variable, and assign it a case-insensitive regular expression that matches the text `dollars`.
|
||||
Inizia dichiarando una variabile `dollarRegex` e assegnale un'espressione regolare insensibile a maiuscole e minuscole che trova il testo `dollars`.
|
||||
|
||||
# --hints--
|
||||
|
||||
You should use `const` to declare a `dollarRegex` variable.
|
||||
Dovresti usare `const` per dichiarare la variabile `dollarRegex`.
|
||||
|
||||
```js
|
||||
assert.match(code, /const\s*dollarRegex\s*=/);
|
||||
```
|
||||
|
||||
Your `dollarRegex` variable should be a regular expression.
|
||||
La variabile `dollarRegex` dovrebbe essere un'espressione regolare.
|
||||
|
||||
```js
|
||||
assert.instanceOf(dollarRegex, RegExp);
|
||||
```
|
||||
|
||||
Your `dollarRegex` should match `dollars`.
|
||||
`dollarRegex` dovrebbe trovare corrispondenza con `dollars`.
|
||||
|
||||
```js
|
||||
assert.match('dollars', dollarRegex);
|
||||
```
|
||||
|
||||
Your `dollarRegex` should be case-insensitive.
|
||||
`dollarRegex` dovrebbe essere insensibile alle maiuscole.
|
||||
|
||||
```js
|
||||
assert.include(dollarRegex.flags, 'i');
|
||||
|
||||
@@ -7,19 +7,19 @@ dashedName: step-14
|
||||
|
||||
# --description--
|
||||
|
||||
Add your `dollarRegex` to the `denyList` array so that you can test the regular expression.
|
||||
Aggiungi `dollarRegex` all'array `denyList` in modo da poter testare l'espressione regolare.
|
||||
|
||||
Then try entering a message in your app.
|
||||
Quindi prova a inserire un messaggio nell'app.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `denyList` array should include `dollarRegex`.
|
||||
L'array `denyList` dovrebbe includere `dollarRegex`.
|
||||
|
||||
```js
|
||||
assert.deepInclude(denyList, dollarRegex);
|
||||
```
|
||||
|
||||
Your `denyList` array should still include `helpRegex`.
|
||||
L'array `denyList` dovrebbe ancora includere `helpRegex`.
|
||||
|
||||
```js
|
||||
assert.deepInclude(denyList, helpRegex);
|
||||
|
||||
@@ -7,27 +7,27 @@ dashedName: step-15
|
||||
|
||||
# --description--
|
||||
|
||||
You need to match a number before the text `dollars`. While you could write out `0|1|2` and so on, regular expressions have a feature that makes this easier.
|
||||
Devi trovare corrispondenza con un numero prima del testo `dollars`. Mentre potresti scrivere `0|1|2` e così via, le espressioni regolari hanno una caratteristica che facilita questo compito.
|
||||
|
||||
A <dfn>character class</dfn> is defined by square brackets, and matches any character within the brackets. For example, `[aeiou]` matches any character in the list `aeiou`. You can also define a range of characters to match using a hyphen. For example, `[a-z]` matches any character from `a` to `z`.
|
||||
Una <dfn>classe di caratteri</dfn> viene definita dalle parentesi quadre e trova corrispondenza con qualsiasi carattere tra parentesi. Ad esempio, `[aeiou]` corrisponde a qualsiasi carattere nella lista `aeiou`. Puoi anche definire un intervallo di caratteri da cercare usando un trattino. Ad esempio, `[a-z]` corrisponde a qualsiasi carattere dalla `a` alla `z`.
|
||||
|
||||
Add a character class to match the digits `0` through `9` to your `dollarRegex` expression - remember the digit must come before the word `dollars`, and there should be a space between the digit and the word.
|
||||
Aggiungi una classe di caratteri per trovare le cifre da `0` a `9` all'espressione `dollarRegex` - ricorda che la cifra deve trovarsi prima della parola `dollars` e ci dovrebbe essere uno spazio tra la cifra e la parola.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `dollarRegex` should use a character class.
|
||||
`dollarRegex` dovrebbe utilizzare una classe di caratteri.
|
||||
|
||||
```js
|
||||
assert.match(dollarRegex.source, /\[.*\]/);
|
||||
```
|
||||
|
||||
Your character class should be `0-9`.
|
||||
La classe di caratteri dovrebbe essere `0-9`.
|
||||
|
||||
```js
|
||||
assert.match(dollarRegex.source, /\[0-9\]/);
|
||||
```
|
||||
|
||||
Your `dollarRegex` should match `1 dollars`.
|
||||
`dollarRegex` dovrebbe trovare corrispondenza con `1 dollars`.
|
||||
|
||||
```js
|
||||
assert.match('1 dollars', dollarRegex);
|
||||
|
||||
@@ -7,31 +7,31 @@ dashedName: step-16
|
||||
|
||||
# --description--
|
||||
|
||||
The dollar value may be more than one digit. To match this, the `+` quantifier can be used - this matches one or more consecutive occurrence. For example, the regular expression `/a+/` matches one or more consecutive `a` characters.
|
||||
Il valore in dollari può avere più di una cifra. Per trovarle puoi usare il quantificatore `+` - indica una o più occorrenze consecutive. Ad esempio, l'espressione regolare `/a+/` corrisponde a uno o più caratteri `a` consecutivi.
|
||||
|
||||
Update your regular expression to match one or more consecutive digits.
|
||||
Aggiorna l'espressione regolare per trovare una o più cifre consecutive.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `dollarRegex` should use the `+` quantifier.
|
||||
`dollarRegex` dovrebbe usare il quantificatore `+`.
|
||||
|
||||
```js
|
||||
assert.match(dollarRegex.source, /\+/);
|
||||
```
|
||||
|
||||
Your `dollarRegex` should use the `+` quantifier on your `[0-9]` character class.
|
||||
`dollarRegex` dovrebbe utilizzare il quantificatore `+` sulla classe di caratteri `[0-9]`.
|
||||
|
||||
```js
|
||||
assert.match(dollarRegex.source, /\[0-9\]\+/);
|
||||
```
|
||||
|
||||
Your `dollarRegex` should match `100 dollars`.
|
||||
`dollarRegex` dovrebbe trovare corrispondenza con `100 dollars`.
|
||||
|
||||
```js
|
||||
assert.match('100 dollars', dollarRegex);
|
||||
```
|
||||
|
||||
Your `dollarRegex` should match `3 dollars`.
|
||||
`dollarRegex` dovrebbe trovare corrispondenza con `3 dollars`.
|
||||
|
||||
```js
|
||||
assert.match('3 dollars', dollarRegex);
|
||||
|
||||
@@ -7,25 +7,25 @@ dashedName: step-17
|
||||
|
||||
# --description--
|
||||
|
||||
Between your digits and your `dollars` text, you want to catch place values.
|
||||
Tra le cifre e il testo `dollars` vuoi catturare i valori di posizione.
|
||||
|
||||
Use the `|` token to allow `hundred`, `thousand`, `million`, or `billion` between your digits and `dollars`.
|
||||
Usa il simbolo `|` per consentire `hundred`, `thousand`, `million` o `billion` tra le cifre e `dollars`.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `dollarRegex` should use the `|` token.
|
||||
`dollarRegex` dovrebbe usare il simbolo `|`.
|
||||
|
||||
```js
|
||||
assert.match(dollarRegex.source, /\|/);
|
||||
```
|
||||
|
||||
Your `dollarRegex` should have three `|` tokens.
|
||||
`dollarRegex` dovrebbe avere tre simboli `|`.
|
||||
|
||||
```js
|
||||
assert.lengthOf(dollarRegex.source.match(/\|/g), 3);
|
||||
```
|
||||
|
||||
Your `dollarRegex` should use the `|` token to match `hundred`, `thousand`, `million`, or `billion`.
|
||||
`dollarRegex` dovrebbe usare il simbolo `|` per trovare riscontro con `hundred`, `thousand`, `million` o `billion`.
|
||||
|
||||
```js
|
||||
const placeValues = dollarRegex.source.replace("[0-9]+ ", "").replace(" dollars", "").split('|');
|
||||
@@ -35,25 +35,25 @@ assert.include(placeValues, 'million');
|
||||
assert.include(placeValues, 'billion');
|
||||
```
|
||||
|
||||
Your `dollarRegex` should match `1 hundred dollars`.
|
||||
`dollarRegex` dovrebbe trovare corrispondenza con `1 hundred dollars`.
|
||||
|
||||
```js
|
||||
assert.match('1 hundred dollars', dollarRegex);
|
||||
```
|
||||
|
||||
Your `dollarRegex` should match `1 thousand dollars`.
|
||||
`dollarRegex` dovrebbe trovare corrispondenza con `1 thousand dollars`.
|
||||
|
||||
```js
|
||||
assert.match('1 thousand dollars', dollarRegex);
|
||||
```
|
||||
|
||||
Your `dollarRegex` should match `1 million dollars`.
|
||||
`dollarRegex` dovrebbe trovare corrispondenza con `1 million dollars`.
|
||||
|
||||
```js
|
||||
assert.match('1 million dollars', dollarRegex);
|
||||
```
|
||||
|
||||
Your `dollarRegex` should match `1 billion dollars`.
|
||||
`dollarRegex` dovrebbe trovare corrispondenza con `1 billion dollars`.
|
||||
|
||||
```js
|
||||
assert.match('1 billion dollars', dollarRegex);
|
||||
|
||||
@@ -7,25 +7,25 @@ dashedName: step-18
|
||||
|
||||
# --description--
|
||||
|
||||
A <dfn>capture group</dfn> is a way to define a part of the expression that should be captured and saved for later reference. You can define a capture group by wrapping a part of your expression in parentheses. For example, `/h(i|ey) camper/` would match either `hi camper` or `hey camper`, and would capture `i` or `ey` in a group.
|
||||
Un <dfn>gruppo di acquisizione</dfn> è un modo per definire una parte dell'espressione che dovrebbe essere catturata e salvata come riferimento. Puoi definire un gruppo di acquisizione racchiudendo tra parentesi tonde una parte dell'espressione. Ad esempio, `/h(i|ey) camper/` troverà riscontro con `hi camper` o `hey camper`, e catturerà `i` o `ey` in un gruppo.
|
||||
|
||||
Turn your place values into a capture group.
|
||||
Trasforma i valori di posizione in un gruppo di acquisizione.
|
||||
|
||||
# --hints--
|
||||
|
||||
You should not change your `helpRegex` regular expression.
|
||||
Non dovresti cambiare l'espressione regolare `helpRegex`.
|
||||
|
||||
```js
|
||||
assert.match(helpRegex.source, /please help|assist me/);
|
||||
```
|
||||
|
||||
Your `dollarRegex` should use a capture group.
|
||||
`dollarRegex` dovrebbe utilizzare un gruppo di acquisizione.
|
||||
|
||||
```js
|
||||
assert.match(dollarRegex.source, /\(.*\)/)
|
||||
```
|
||||
|
||||
Your `hundred|thousand|million|billion` pattern should be a capture group.
|
||||
Il pattern `hundred|thousand|million|billion` dovrebbe essere un gruppo di acquisizione.
|
||||
|
||||
```js
|
||||
assert.match(dollarRegex.source, /\(hundred\|thousand\|million\|billion\)/)
|
||||
|
||||
@@ -7,19 +7,19 @@ dashedName: step-19
|
||||
|
||||
# --description--
|
||||
|
||||
Now that you have your capture group, you can mark the entire pattern as an optional match. The `?` quantifier matches zero or one occurrence of the preceding character or group. For example, the regular expression `/colou?r/` matches both `color` and `colour`, because the `u` is optional.
|
||||
Ora che hai un gruppo di acquisizione, puoi contrassegnare l'intero pattern come una corrispondenza opzionale. Il quantificatore `?` corrisponde a zero o a una occorrenza del carattere o gruppo precedente. Ad esempio, l'espressione regolare `/colou?r/` corrisponde sia a `color` che a `colour`, perché la `u` è opzionale.
|
||||
|
||||
Mark your capture group as optional.
|
||||
Denota il gruppo di acquisizione come opzionale.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `dollarRegex` should use the `?` quantifier.
|
||||
`dollarRegex` dovrebbe usare il quantificatore `?`.
|
||||
|
||||
```js
|
||||
assert.match(dollarRegex.source, /\?/);
|
||||
```
|
||||
|
||||
Your `(hundred|thousand|million|billion)` capture group should be optional.
|
||||
Il gruppo di acquisizione `(hundred|thousand|million|billion)` dovrebbe essere opzionale.
|
||||
|
||||
```js
|
||||
assert.match(dollarRegex.source, /\(hundred\|thousand\|million\|billion\)\?/);
|
||||
|
||||
@@ -7,33 +7,33 @@ dashedName: step-20
|
||||
|
||||
# --description--
|
||||
|
||||
One last thing with this expression. You don't actually need the match value from your capture group, so you can turn it into a <dfn>non-capturing group</dfn>. This will allow you to group the characters together without preserving the result.
|
||||
Un'ultima cosa riguardo a questa espressione. In realtà non hai bisogno del valore trovato dal gruppo di acquisizione, quindi puoi trasformarlo in un <dfn>gruppo di non acquisizione</dfn>. Questo ti permetterà di raggruppare insieme i caratteri senza conservare il risultato.
|
||||
|
||||
To create a non-capturing group in a regular expression, you can add `?:` after the opening parenthesis of a group. For instance, `(?:a|b)` will match either `a` or `b`, but it will not capture the result.
|
||||
Per creare un gruppo di non acquisizione in un'espressione regolare puoi aggiungere `?:` dopo la parentesi di apertura di un gruppo. Ad esempio, `(?:a|b)` troverà `a` o `b`, ma non acquisirà il risultato.
|
||||
|
||||
Update your regular expression to use a non-capturing group.
|
||||
Aggiorna l'espressione regolare per usare un gruppo di non acquisizione.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `dollarRegex` should use `?:`.
|
||||
`dollarRegex` dovrebbe usare `?:`.
|
||||
|
||||
```js
|
||||
assert.match(dollarRegex.source, /\?:/);
|
||||
```
|
||||
|
||||
Your `dollarRegex` should use a non-capturing group.
|
||||
`dollarRegex` dovrebbe utilizzare un gruppo di non acquisizione.
|
||||
|
||||
```js
|
||||
assert.match(dollarRegex.source, /\(\?:.*\)/);
|
||||
```
|
||||
|
||||
Your `(hundred|thousand|million|billion)` should be a non-capturing group.
|
||||
`(hundred|thousand|million|billion)` dovrebbe essere un gruppo di non acquisizione.
|
||||
|
||||
```js
|
||||
assert.match(dollarRegex.source, /\(\?:hundred\|thousand\|million\|billion\)/);
|
||||
```
|
||||
|
||||
Your `(hundred|thousand|million|billion)` group should still be optional.
|
||||
Il gruppo `(hundred|thousand|million|billion)` dovrebbe ancora essere opzionale.
|
||||
|
||||
```js
|
||||
assert.match(dollarRegex.source, /\(\?:hundred\|thousand\|million\|billion\)\?/);
|
||||
|
||||
@@ -7,29 +7,29 @@ dashedName: step-21
|
||||
|
||||
# --description--
|
||||
|
||||
Your next regular expression will look for strings like `free money`. Start by declaring a `freeRegex` variable and assigning it a regular expression that will match the string `free money`. Remember to make it case-insensitive.
|
||||
La prossima espressione regolare cercherà stringhe come `free money`. Inizia dichiarando una variabile `freeRegex` e assegnale un'espressione regolare che trova riscontro con la stringa `free money`. Ricordati di renderla insensibile alle maiuscole.
|
||||
|
||||
# --hints--
|
||||
|
||||
You should declare a `freeRegex` variable using `const`.
|
||||
Dovresti dichiarare una variabile `freeRegex` usando `const`.
|
||||
|
||||
```js
|
||||
assert.match(code, /const\s*freeRegex\s*=/);
|
||||
```
|
||||
|
||||
Your `freeRegex` variable should be a regular expression.
|
||||
La variabile `freeRegex` dovrebbe essere un'espressione regolare.
|
||||
|
||||
```js
|
||||
assert.instanceOf(freeRegex, RegExp);
|
||||
```
|
||||
|
||||
Your `freeRegex` should match `free money`.
|
||||
`freeRegex` dovrebbe trovare corrispondenza con `free money`.
|
||||
|
||||
```js
|
||||
assert.match('free money', freeRegex);
|
||||
```
|
||||
|
||||
Your `freeRegex` should be case-insensitive.
|
||||
`freeRegex` dovrebbe essere insensibile alle maiuscole.
|
||||
|
||||
```js
|
||||
assert.include(freeRegex.flags, 'i');
|
||||
|
||||
@@ -7,23 +7,23 @@ dashedName: step-22
|
||||
|
||||
# --description--
|
||||
|
||||
Add your new regular expression to your `denyList` array so you can test it.
|
||||
Aggiungi la nuova espressione regolare all'array `denyList` in modo da poterla testare.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `denyList` array should include your `freeRegex` variable.
|
||||
L'array `denyList` dovrebbe includere la variabile `freeRegex`.
|
||||
|
||||
```js
|
||||
assert.deepInclude(denyList, freeRegex);
|
||||
```
|
||||
|
||||
Your `denyList` array should include your `dollarRegex` variable.
|
||||
L'array `denyList` dovrebbe includere la variabile `dollarRegex`.
|
||||
|
||||
```js
|
||||
assert.deepInclude(denyList, dollarRegex);
|
||||
```
|
||||
|
||||
Your `denyList` array should include your `helpRegex` variable.
|
||||
L'array `denyList` dovrebbe includere la variabile `helpRegex`.
|
||||
|
||||
```js
|
||||
assert.deepInclude(denyList, helpRegex);
|
||||
|
||||
@@ -7,37 +7,37 @@ dashedName: step-23
|
||||
|
||||
# --description--
|
||||
|
||||
Spam messages often use numbers instead of letters to bypass filters. Your regular expression should catch these.
|
||||
I messaggi di spam usano spesso i numeri invece delle lettere per aggirare i filtri. La tua espressione regolare dovrebbe catturarli.
|
||||
|
||||
Replace the `e` characters in your regular expression with character classes that match `e` and `3`.
|
||||
Sostituisci i caratteri `e` nell'espressione regolare con classi di caratteri che corrispondono a `e` e `3`.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `freeRegex` should use a character class.
|
||||
`freeRegex` dovrebbe utilizzare una classe di caratteri.
|
||||
|
||||
```js
|
||||
assert.match(freeRegex.source, /\[.*\]/);
|
||||
```
|
||||
|
||||
Your `freeRegex` should use a character class to match `e` and `3`.
|
||||
`freeRegex` dovrebbe usare una classe di caratteri per trovare `e` e `3`.
|
||||
|
||||
```js
|
||||
assert.match(freeRegex.source, /\[(e3|3e)\]/);
|
||||
```
|
||||
|
||||
Your `freeRegex` should use three character classes to match `e` and `3`.
|
||||
`freeRegex` dovrebbe usare tre classi di caratteri per trovare `e` e `3`.
|
||||
|
||||
```js
|
||||
assert.lengthOf(freeRegex.source.match(/\[(e3|3e)\]/g), 3);
|
||||
```
|
||||
|
||||
Your `freeRegex` should match `free money`.
|
||||
`freeRegex` dovrebbe trovare corrispondenza con `free money`.
|
||||
|
||||
```js
|
||||
assert.match('free money', freeRegex);
|
||||
```
|
||||
|
||||
Your `freeRegex` should match `fr33 mon3y`.
|
||||
`freeRegex` dovrebbe trovare corrispondenza con `fr33 mon3y`.
|
||||
|
||||
```js
|
||||
assert.match('fr33 mon3y', freeRegex);
|
||||
|
||||
@@ -7,23 +7,23 @@ dashedName: step-24
|
||||
|
||||
# --description--
|
||||
|
||||
Now update your `o` character to match `o` and `0` (the digit).
|
||||
Ora aggiorna il carattere `o` per trovare corrispondenza con `o` e `0` (la cifra).
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `freeRegex` should use a character class to match `o` and `0`.
|
||||
`freeRegex` dovrebbe usare una classe di caratteri per trovare `o` e `0`.
|
||||
|
||||
```js
|
||||
assert.match(freeRegex.source, /\[(o0|0o)\]/);
|
||||
```
|
||||
|
||||
Your `freeRegex` should match `free money`.
|
||||
`freeRegex` dovrebbe trovare corrispondenza con `free money`.
|
||||
|
||||
```js
|
||||
assert.match('free money', freeRegex);
|
||||
```
|
||||
|
||||
Your `freeRegex` should match `fr33 m0n3y`.
|
||||
`freeRegex` dovrebbe trovare corrispondenza con `fr33 m0n3y`.
|
||||
|
||||
```js
|
||||
assert.match('fr33 m0n3y', freeRegex);
|
||||
|
||||
@@ -7,19 +7,19 @@ dashedName: step-25
|
||||
|
||||
# --description--
|
||||
|
||||
Your regex should match whole words, not partial words. That is, you do not want to match `hands-free money management`.
|
||||
L'espressione regolare dovrebbe trovare riscontro con parole intere, non con delle porzioni di parole. Ovvero, non vuoi trovare riscontro con `hands-free money management`.
|
||||
|
||||
To do this, start by checking for spaces before and after your pattern. You can do this by using the meta character `\s`, which will match spaces, tabs, and line breaks.
|
||||
Per fare ciò, inizia controllando gli spazi prima e dopo il pattern. Puoi farlo usando il metacarattere `\s`, che corrisponde a spazi, tabulazioni e interruzioni di riga.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `freeRegex` should use the `\s` token.
|
||||
`freeRegex` dovrebbe usare il simbolo `\s`.
|
||||
|
||||
```js
|
||||
assert.match(freeRegex.source, /\s/);
|
||||
```
|
||||
|
||||
Your `freeRegex` should look for spaces at the beginning and end of your pattern.
|
||||
`freeRegex` dovrebbe cercare spazi all'inizio e alla fine del pattern.
|
||||
|
||||
```js
|
||||
assert.isTrue(freeRegex.source.startsWith('\\s'));
|
||||
|
||||
@@ -7,39 +7,39 @@ dashedName: step-26
|
||||
|
||||
# --description--
|
||||
|
||||
If you try entering the message `free money`, you'll notice it doesn't match your expression! This is because `\s` doesn't match the beginning or end of the text.
|
||||
Se provi a inserire il messaggio `free money`, noterai che non viene trovata dalla tua espressione! Questo perché `\s` non trova riscontro all'inizio o alla fine del testo.
|
||||
|
||||
To match the beginning of the text, you can use the `^` anchor. This asserts that your pattern match starts at the beginning of the full string.
|
||||
Per trovare corrispondenza all'inizio del testo, è possibile utilizzare l'ancoraggio `^`. Ciò impone che la corrispondenza con il pattern parta all'inizio dell'intera stringa.
|
||||
|
||||
Replace your first `\s` character with a non-capturing group that matches `\s` or `^`.
|
||||
Sostituisci il primo carattere `\s` con un gruppo di non acquisizione che trova `\s` o `^`.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `freeRegex` should use a non-capturing group.
|
||||
`freeRegex` dovrebbe utilizzare un gruppo di non acquisizione.
|
||||
|
||||
```js
|
||||
assert.match(freeRegex.source, /\(\?:/);
|
||||
```
|
||||
|
||||
Your `freeRegex` should use a non-capturing group to match `\s` or `^`.
|
||||
`freeRegex` dovrebbe usare un gruppo di non acquisizione per trovare `\s` o `^`.
|
||||
|
||||
```js
|
||||
assert.match(freeRegex.source, /\(\?:(\^\|\\s|\\s\|\^)\)/);
|
||||
```
|
||||
|
||||
Your `freeRegex` should match `it's free money time`.
|
||||
`freeRegex` dovrebbe trovare corrispondenza con `it's free money time`.
|
||||
|
||||
```js
|
||||
assert.match("it's free money time", freeRegex);
|
||||
```
|
||||
|
||||
Your `freeRegex` should match `free money time`.
|
||||
`freeRegex` dovrebbe trovare corrispondenza con `free money time`.
|
||||
|
||||
```js
|
||||
assert.match('free money time', freeRegex);
|
||||
```
|
||||
|
||||
Your `freeRegex` should not match `hands-free money time`.
|
||||
`freeRegex` non dovrebbe trovare corrispondenza con `hands-free money time`.
|
||||
|
||||
```js
|
||||
assert.notMatch('hands-free money', freeRegex);
|
||||
|
||||
@@ -7,57 +7,57 @@ dashedName: step-27
|
||||
|
||||
# --description--
|
||||
|
||||
You still aren't matching `free money` yet, because you need to match the end of the string as well.
|
||||
Non stai ancora trovando `free money`, perché devi indicare anche la fine della stringa.
|
||||
|
||||
Like the `^` anchor, you can use the `$` anchor to match the end of the string.
|
||||
Allo stesso modo dell'ancoraggio `^`, puoi usare l'ancoraggio `$` per indicare la fine della stringa.
|
||||
|
||||
Update your regular expression to match either the end of the string or a space, like you did for the beginning of the string.
|
||||
Aggiorna l'espressione regolare per trovare riscontro con la fine della stringa o con uno spazio, come hai fatto per l'inizio della stringa.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `freeRegex` should use a second non-capturing group.
|
||||
`freeRegex` dovrebbe utilizzare un secondo gruppo di non acquisizione.
|
||||
|
||||
```js
|
||||
assert.lengthOf(freeRegex.source.match(/\(\?:/g), 2);
|
||||
```
|
||||
|
||||
Your `freeRegex` should use a non-capturing group to match `\s` or `$`.
|
||||
`freeRegex` dovrebbe usare un gruppo di non acquisizione per trovare `\s` o `$`.
|
||||
|
||||
```js
|
||||
assert.match(freeRegex.source, /\(\?:(\$\|\\s|\\s\|\$)\)/);
|
||||
```
|
||||
|
||||
Your `freeRegex` should match `it's free money time`.
|
||||
`freeRegex` dovrebbe trovare corrispondenza con `it's free money time`.
|
||||
|
||||
```js
|
||||
assert.match("it's free money time", freeRegex);
|
||||
```
|
||||
|
||||
Your `freeRegex` should match `free money time`.
|
||||
`freeRegex` dovrebbe trovare corrispondenza con `free money time`.
|
||||
|
||||
```js
|
||||
assert.match('free money time', freeRegex);
|
||||
```
|
||||
|
||||
Your `freeRegex` should match `it's free money`.
|
||||
`freeRegex` dovrebbe trovare corrispondenza con `it's free money`.
|
||||
|
||||
```js
|
||||
assert.match("it's free money", freeRegex);
|
||||
```
|
||||
|
||||
Your `freeRegex` should match `free money`.
|
||||
`freeRegex` dovrebbe trovare corrispondenza con `free money`.
|
||||
|
||||
```js
|
||||
assert.match('free money', freeRegex);
|
||||
```
|
||||
|
||||
Your `freeRegex` should not match `hands-free money time`.
|
||||
`freeRegex` non dovrebbe trovare corrispondenza con `hands-free money time`.
|
||||
|
||||
```js
|
||||
assert.notMatch('hands-free money', freeRegex);
|
||||
```
|
||||
|
||||
Your `freeRegex` should not match `free money-management`.
|
||||
`freeRegex` non dovrebbe trovare corrispondenza con `free money-management`.
|
||||
|
||||
```js
|
||||
assert.notMatch('free money-management', freeRegex);
|
||||
|
||||
@@ -7,55 +7,55 @@ dashedName: step-28
|
||||
|
||||
# --description--
|
||||
|
||||
Your next regular expression will match strings like `stock alert`. Declare a `stockRegex` variable and assign it a regular expression that will match the string `stock alert`. Remember to make it case insensitive.
|
||||
La prossima espressione regolare troverà stringhe come `stock alert`. Dichiara una variabile `stockRegex` e assegnale un'espressione regolare che troverà la stringa `stock alert`. Ricordati di renderla insensibile alle maiuscole.
|
||||
|
||||
Add it to your `denyList` array as well.
|
||||
Aggiungila all'array `denyList`.
|
||||
|
||||
# --hints--
|
||||
|
||||
You should use `const` to declare your `stockRegex` variable.
|
||||
Dovresti usare `const` per dichiarare la variabile `stockRegex`.
|
||||
|
||||
```js
|
||||
assert.match(code, /const\s+stockRegex\s*=/);
|
||||
```
|
||||
|
||||
Your `stockRegex` variable should be assigned a regular expression.
|
||||
Alla variabile `stockRegex` dovrebbe essere assegnata un'espressione regolare.
|
||||
|
||||
```js
|
||||
assert.instanceOf(stockRegex, RegExp);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `stock alert`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `stock alert`.
|
||||
|
||||
```js
|
||||
assert.match('stock alert', stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should be case-insensitive.
|
||||
`stockRegex` dovrebbe essere insensibile alle maiuscole.
|
||||
|
||||
```js
|
||||
assert.include(stockRegex.flags, 'i');
|
||||
```
|
||||
|
||||
Your `denyList` array should contain `stockRegex`.
|
||||
L'array `denyList` dovrebbe contenere `stockRegex`.
|
||||
|
||||
```js
|
||||
assert.deepInclude(denyList, stockRegex);
|
||||
```
|
||||
|
||||
Your `denyList` array should contain `freeRegex`.
|
||||
L'array `denyList` dovrebbe contenere `freeRegex`.
|
||||
|
||||
```js
|
||||
assert.deepInclude(denyList, freeRegex);
|
||||
```
|
||||
|
||||
Your `denyList` array should contain `dollarRegex`.
|
||||
L'array `denyList` dovrebbe contenere `dollarRegex`.
|
||||
|
||||
```js
|
||||
assert.deepInclude(denyList, dollarRegex);
|
||||
```
|
||||
|
||||
Your `denyList` array should contain `helpRegex`.
|
||||
L'array `denyList` dovrebbe contenere `helpRegex`.
|
||||
|
||||
```js
|
||||
assert.deepInclude(denyList, helpRegex);
|
||||
|
||||
@@ -7,29 +7,29 @@ dashedName: step-29
|
||||
|
||||
# --description--
|
||||
|
||||
Like your `freeRegex`, update your `stockRegex` to replace the `e` and `o` characters with character classes to match the letter and the corresponding number.
|
||||
Come per `freeRegex`, aggiorna `stockRegex` per sostituire i caratteri `e` e `o` con le classi di caratteri che trovano la lettera e il numero corrispondente.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `stockRegex` should use a character class to match the letter `e` and the number `3`.
|
||||
`stockRegex` dovrebbe usare una classe di caratteri per trovare la lettera `e` e il numero `3`.
|
||||
|
||||
```js
|
||||
assert.match(stockRegex.source, /\[(e3|3e)\]/);
|
||||
```
|
||||
|
||||
Your `stockRegex` should use a character class to match the letter `o` and the number `0`.
|
||||
`stockRegex` dovrebbe usare una classe di caratteri per trovare la lettera `o` e il numero `0`.
|
||||
|
||||
```js
|
||||
assert.match(stockRegex.source, /\[(o0|0o)\]/);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `stock alert`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `stock alert`.
|
||||
|
||||
```js
|
||||
assert.match('stock alert', stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `st0ck al3rt`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `st0ck al3rt`.
|
||||
|
||||
```js
|
||||
assert.match('st0ck al3rt', stockRegex);
|
||||
|
||||
@@ -7,29 +7,29 @@ dashedName: step-30
|
||||
|
||||
# --description--
|
||||
|
||||
Next update your `s` and `t` characters to also match `5` and `7` respectively.
|
||||
Adesso aggiorna i caratteri `s` e `t` per trovare rispettivamente anche `5` e `7`.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `stockRegex` should use a character class to match the letter `s` and the number `5`.
|
||||
`stockRegex` dovrebbe usare una classe di caratteri per trovare la lettera `s` e il numero `5`.
|
||||
|
||||
```js
|
||||
assert.match(stockRegex.source, /\[(s5|5s)\]/);
|
||||
```
|
||||
|
||||
Your `stockRegex` should use a character class to match the letter `t` and the number `7`.
|
||||
`stockRegex` dovrebbe usare una classe di caratteri per trovare la lettera `t` e il numero `7`.
|
||||
|
||||
```js
|
||||
assert.match(stockRegex.source, /\[(t7|7t)\]/);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `stock alert`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `stock alert`.
|
||||
|
||||
```js
|
||||
assert.match('stock alert', stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `570ck al3r7`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `570ck al3r7`.
|
||||
|
||||
```js
|
||||
assert.match('570ck al3r7', stockRegex);
|
||||
|
||||
@@ -7,35 +7,35 @@ dashedName: step-31
|
||||
|
||||
# --description--
|
||||
|
||||
Character classes can take more than two characters. Replace your `a` character with a character class that matches `a`, `@`, and `4`.
|
||||
Le classi di caratteri possono contenere più di due caratteri. Sostituisci il carattere `a` con una classe di caratteri che indica `a`, `@` e `4`.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `stockRegex` should use a character class to match `a`, `@`, and `4`.
|
||||
`stockRegex` dovrebbe usare una classe di caratteri che indica `a`, `@` e `4`.
|
||||
|
||||
```js
|
||||
assert.match(stockRegex.source, /\[(a@4|a4@|4@a|4a@|@a4|@4a)]/);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `stock alert`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `stock alert`.
|
||||
|
||||
```js
|
||||
assert.match('stock alert', stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `stock @lert`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `stock @lert`.
|
||||
|
||||
```js
|
||||
assert.match('stock @lert', stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `stock 4lert`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `stock 4lert`.
|
||||
|
||||
```js
|
||||
assert.match('stock 4lert', stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `570ck 4l3r7`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `570ck 4l3r7`.
|
||||
|
||||
```js
|
||||
assert.match('570ck 4l3r7', stockRegex);
|
||||
|
||||
@@ -7,35 +7,35 @@ dashedName: step-32
|
||||
|
||||
# --description--
|
||||
|
||||
Using the same syntax, update `c` to match `c`, `{`, `[`, and `(`.
|
||||
Usando la stessa sintassi, aggiorna `c` per trovare `c`, `{`, `[` e `(`.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `stockRegex` should use a character class to match `c`, `{`, `[`, and `(`.
|
||||
`stockRegex` dovrebbe usare una classe di caratteri che indica `c`, `{`, `[` e `(`.
|
||||
|
||||
```js
|
||||
assert.match(stockRegex.source, /\[(c\{\[\(|\{c\[\(|\[c\{\(|c\[\{\(|\{\[c\(|\[\{c\(|\[\{\(c|\{\[\(c|\(\[\{c|\[\(\{c|\{\(\[c|\(\{\[c|\(c\[\{|c\(\[\{|\[\(c\{|\(\[c\{|c\[\(\{|\[c\(\{|\{c\(\[|c\{\(\[|\(\{c\[|\{\(c\[|c\(\{\[|\(c\{\[)\]/);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `stock alert`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `stock alert`.
|
||||
|
||||
```js
|
||||
assert.match('stock alert', stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `570(k 4l3r7`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `570(k 4l3r7`.
|
||||
|
||||
```js
|
||||
assert.match('570(k 4l3r7', stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `sto{k alert`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `sto{k alert`.
|
||||
|
||||
```js
|
||||
assert.match('sto{k alert', stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `sto[k alert`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `sto[k alert`.
|
||||
|
||||
```js
|
||||
assert.match('sto[k alert', stockRegex);
|
||||
|
||||
@@ -7,65 +7,65 @@ dashedName: step-33
|
||||
|
||||
# --description--
|
||||
|
||||
Finally, allow your regex to match whole words (like you did with `freeRegex`).
|
||||
Infine, permetti all'espressione regolare di trovare parole intere (come hai fatto con `freeRegex`).
|
||||
|
||||
# --hints--
|
||||
|
||||
Your `stockRegex` should use a non-capturing group.
|
||||
`stockRegex` dovrebbe usare un gruppo di non acquisizione.
|
||||
|
||||
```js
|
||||
assert.match(stockRegex.source, /\(\?:/);
|
||||
```
|
||||
|
||||
Your `stockRegex` should use a non-capturing group to match `\s` or `^`.
|
||||
`stockRegex` dovrebbe usare un gruppo di non acquisizione che indica `\s` o `^`.
|
||||
|
||||
```js
|
||||
assert.match(stockRegex.source, /\(\?:(\^\|\\s|\\s\|\^)\)/);
|
||||
```
|
||||
|
||||
Your `stockRegex` should use a second non-capturing group.
|
||||
`stockRegex` dovrebbe utilizzare un secondo gruppo di non acquisizione.
|
||||
|
||||
```js
|
||||
assert.lengthOf(stockRegex.source.match(/\(\?:/g), 2);
|
||||
```
|
||||
|
||||
Your `stockRegex` should use a non-capturing group to match `\s` or `$`.
|
||||
`stockRegex` dovrebbe usare un gruppo di non acquisizione che indica `\s` o `$`.
|
||||
|
||||
```js
|
||||
assert.match(stockRegex.source, /\(\?:(\$\|\\s|\\s\|\$)\)/);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `it's stock alert time`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `it's stock alert time`.
|
||||
|
||||
```js
|
||||
assert.match("it's stock alert time", stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `stock alert time`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `stock alert time`.
|
||||
|
||||
```js
|
||||
assert.match('stock alert time', stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `it's stock alert`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `it's stock alert`.
|
||||
|
||||
```js
|
||||
assert.match("it's stock alert", stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should match `stock alert`.
|
||||
`stockRegex` dovrebbe trovare corrispondenza con `stock alert`.
|
||||
|
||||
```js
|
||||
assert.match('stock alert', stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should not match `hands-stock alert time`.
|
||||
`stockRegex` non dovrebbe trovare corrispondenza con `hands-stock alert time`.
|
||||
|
||||
```js
|
||||
assert.notMatch('hands-stock alert', stockRegex);
|
||||
```
|
||||
|
||||
Your `stockRegex` should not match `stock alert-management`.
|
||||
`stockRegex` non dovrebbe trovare corrispondenza con `stock alert-management`.
|
||||
|
||||
```js
|
||||
assert.notMatch('stock alert-management', stockRegex);
|
||||
|
||||
@@ -7,7 +7,7 @@ dashedName: step-34
|
||||
|
||||
# --description--
|
||||
|
||||
Your final regular expression will look for strings like `dear friend`. Declare a `dearRegex` and assign it a regular expression that will match the string `dear friend`. Remember to make it case insensitive, and add it to your `denyList` array.
|
||||
L'ultima espressione regolare cercherà stringhe come `dear friend`. Declare a `dearRegex` and assign it a regular expression that will match the string `dear friend`. Remember to make it case insensitive, and add it to your `denyList` array.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ dashedName: add-font-awesome-icons-to-all-of-our-buttons
|
||||
|
||||
# --description--
|
||||
|
||||
Font Awesome é uma biblioteca conveniente de ícones. Estes ícones podem ser fontes da web ou gráficos vetoriais. Estes ícones são tratados assim como as fontes. Você pode especificar seu tamanho utilizando pixels, e eles irão assumir o tamanho de fonte de seus elementos HTML parentes.
|
||||
Font Awesome é uma biblioteca conveniente de ícones. Estes ícones podem ser fontes da web ou gráficos vetoriais. Estes ícones são tratados assim como as fontes. Você pode especificar seu tamanho utilizando pixels, e eles assumirão o tamanho de fonte de seus elementos pais no HTML.
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ dashedName: add-font-awesome-icons-to-our-buttons
|
||||
|
||||
# --description--
|
||||
|
||||
Font Awesome é uma biblioteca conveniente de ícones. Estes ícones podem ser fontes da web ou gráficos vetoriais. Estes ícones são tratados assim como as fontes. Você pode especificar seu tamanho utilizando pixels, e eles irão assumir o tamanho de fonte de seus elementos HTML parentes.
|
||||
Font Awesome é uma biblioteca conveniente de ícones. Estes ícones podem ser fontes da web ou gráficos vetoriais. Estes ícones são tratados assim como as fontes. Você pode especificar seu tamanho utilizando pixels, e eles assumirão o tamanho de fonte de seus elementos pais no HTML.
|
||||
|
||||
Você pode incluir o Font Awesome em qualquer aplicativo, adicionando o seguinte código ao topo do seu HTML:
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Aqui está como você rescreveria e enfatizaria o texto do nosso cabeçalho:
|
||||
$("h3").html("<em>jQuery Playground</em>");
|
||||
```
|
||||
|
||||
O jQuery também possui uma função similar chamada `.text()` que altera apenas texto sem adicionar tags. Em outras palavras, essa função não irá avaliar nenhuma tag HTML passada a ela, mas ao invés disso irá tratá-la como o texto que você quer substituir o conteúdo atual existente.
|
||||
O jQuery também possui uma função similar chamada `.text()` que altera apenas texto sem adicionar tags. Em outras palavras, essa função não irá avaliar nenhuma tag HTML passada a ela, mas, ao invés disso, a tratará como o texto que você quer substituir o conteúdo atual existente.
|
||||
|
||||
Modifique o botão com id `target4` enfatizando seu texto.
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ dashedName: target-the-parent-of-an-element-using-jquery
|
||||
|
||||
Todo elemento HTML possui um elemento `parent` do qual `inherits` (herda) propriedades.
|
||||
|
||||
For example, the `h3` element in your `jQuery Playground` has the parent element of `<div class="container-fluid">`, which itself has the parent element of `body`.
|
||||
Por exemplo, o elemento `h3` do `jQuery Playground` tem o elemento pai `<div class="container-fluid">`, que, por sua vez, tem `body` como seu elemento pai.
|
||||
|
||||
O jQuery possui uma função chamada `parent()` que o permite acessar o parente de qualquer elemento que você selecionou.
|
||||
O jQuery possui uma função chamada `parent()` que o permite acessar o elemento pai de qualquer elemento que você selecionou.
|
||||
|
||||
Aqui está um exemplo de como você usaria a função `parent()` se você quisesse dar ao elemento pai do elemento `left-well` uma cor de fundo azul:
|
||||
|
||||
@@ -20,7 +20,7 @@ Aqui está um exemplo de como você usaria a função `parent()` se você quises
|
||||
$("#left-well").parent().css("background-color", "blue")
|
||||
```
|
||||
|
||||
Dê ao parente do elemento `#target1` uma cor de fundo (background-color) vermelha.
|
||||
Dê ao elemento pai do elemento `#target1` uma cor de fundo (background-color) vermelha.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Sempre que você se refere a um componente de classe dentro dele mesmo, você us
|
||||
|
||||
# --instructions--
|
||||
|
||||
Renderize uma instância do componente `Welcome` no componente parente `App`. Aqui, dê a `Welcome` uma "prop" `name` e atribua a ela um valor de uma string. Dentro do elemento filho, `Welcome`, acesse a propriedade `name` dentro das tags `strong`.
|
||||
Renderize uma instância do componente `Welcome` no componente pai `App`. Aqui, dê a `Welcome` uma "prop" `name` e atribua a ela um valor de uma string. Dentro do elemento filho, `Welcome`, acesse a propriedade `name` dentro das tags `strong`.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
Reference in New Issue
Block a user