Whale tack project - resultString

Hey, i was doing the whale talk project and I have a question. (link: https://www.codecademy.com/journeys/front-end-engineer/paths/fecj-22-building-interactive-websites/tracks/fecj-22-javascript-syntax-part-ii/modules/wdcp-22-learn-javascript-syntax-loops-2dbf8978-3b41-4a0f-aace-0cd3adb58958/projects/whale-talk)

I was doing the 13 checkbox and i ran into a problem.
When I do this, the function works fine:

let resultArray = ;

// rest of the code

console.log(resultArray.join(’ ');

but when i do this, the console doesn’t give me any feedback, it’s just black:

let resultArray = ;
let resultString = resultArray.join(’ ');

// rest of the code

console.log(resultString);

Why this happens?

We cannot join an empty array. It needs to be populated before we can join the members.

let a = 'abcdefghijklmnopqrstuvwxyz'.split('')
let b = a.join(', ')
console.log(b)
// 'a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z'
1 Like