Message from JavaScript discussions

January 2018

— Guys I need little help

— 

Function theBeatlesPlay([Beatles, Agulero, Michael Jackson], [Guitar, Musical, Piano, Fortopiano]){
var arr = [""];
for(var i = 0; i <= arr.length; i++){
console.log(arr[0][i]);
}
}
theBeatlesPlay();

— How can i get from function arrays Beatles plays Guitar

— Https://flickity.metafizzy.co/

— What were you thinking here?

— I need to get Beatles from first array and Guitar from second array and put them together in one sentence as string

Message permanent page

— Syntax error)

— 

function theBeatlesPlay(artists, instruments) {
console.log(
artists[0] +
" plays " +
instruments[0]
);
}

theBeatlesPlay([
"Beatles",
"Agulero",
"Michael Jackson"
], [
"Guitar",
"Musical",
"Piano",
"Fortopiano"
]);

Message permanent page

— Yeah but I have to use for loop

— By creating empty array var

— This is argument destructuring

— Like so: var arr = [" "];