const services = ['Design', 'Dezvoltare', 'SEO'];
function printService(service) {
console.log(service);
}
services.forEach(printService);The function receives and prints each service in turn.
LESSON 49 OF 50
Apply the same function to every array element.
forEach calls the callback once for each existing element in ascending index order. It does not build a result array.
const services = ['Design', 'Dezvoltare', 'SEO'];
function printService(service) {
console.log(service);
}
services.forEach(printService);The function receives and prints each service in turn.
console.log('Design');
console.log('Dezvoltare');
console.log('SEO');The output is manually imitated and no callback is used.
Declare printService(service), then pass the function to services.forEach.
Run the code to see the result.forEach controls iteration, while the function describes the operation for one element.
ANALYSIS REQUEST
The initial discussion is without obligation. You receive an honest recommendation, suitable stages and the factors that affect price.