Message from JavaScript discussions

January 2018

— 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

— 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 = [" "];

— Right...

— Is this homework?

— And get that arr later

— Yeah its my homework