diff --git a/1-js/11-async/01-callbacks/01-animate-circle-callback/task.md b/1-js/11-async/01-callbacks/01-animate-circle-callback/task.md index 4a20ca604..c159581ad 100644 --- a/1-js/11-async/01-callbacks/01-animate-circle-callback/task.md +++ b/1-js/11-async/01-callbacks/01-animate-circle-callback/task.md @@ -1,15 +1,15 @@ # Animated circle with callback -In the task an animated growing circle is shown. +Nel task è mostrato un cerchio crescente animato. -Now let's say we need not just a circle, but to show a message inside it. The message should appear *after* the animation is complete (the circle is fully grown), otherwise it would look ugly. +Ora diciamo che non vogliamo solo un cerchio, ma anche mostrare un messaggio al suo interno. Il messaggio dovrebbe apparire *dopo* che l'animazione è completa (il cerchio è cresciuto del tutto), altrimenti sarebbe brutto. -In the solution of the task, the function `showCircle(cx, cy, radius)` draws the circle, but gives no way to track when it's ready. +Nella soluzione del task, la funzione `showCircle(cx, cy, radius)` disegna il cerchio, ma non da modo di tracciare quando è pronto. -Add a callback argument: `showCircle(cx, cy, radius, callback)` to be called when the animation is complete. The `callback` should receive the circle `
` as an argument. +Aggiungi un argomento callback: `showCircle(cx, cy, radius, callback)` da chiamare quando l'animazione è completa. La `callback` dovrebbe il `
` cerchio come argomento. -Here's the example: +Ecco l'esempio: ```js showCircle(150, 150, 100, div => { @@ -22,4 +22,4 @@ Demo: [iframe src="solution" height=260] -Take the solution of the task as the base. +Prendi la soluzione task come base. diff --git a/1-js/11-async/01-callbacks/article.md b/1-js/11-async/01-callbacks/article.md index ee0bb3caa..747b73613 100644 --- a/1-js/11-async/01-callbacks/article.md +++ b/1-js/11-async/01-callbacks/article.md @@ -1,10 +1,10 @@ -# Introduction: callbacks +# Introduzione: callbacks -Many actions in JavaScript are *asynchronous*. +Molte azioni in JavaScript sono *asincrone* -For instance, take a look at the function `loadScript(src)`: +Per esempio, guardiamo la funzione `loadScript(src)`: ```js function loadScript(src) { @@ -14,40 +14,42 @@ function loadScript(src) { } ``` -The purpose of the function is to load a new script. When it adds the `