20th Jul 2022, 12:26 AM
Varin
Varin - avatar
4 ответов
+ 2
Line 3: You iterated <frequency> which is a function where you ahould be iterating the <phrase> atring argument.
20th Jul 2022, 12:33 AM
Ipang
+ 1
Ipang it worked but another problem occured it returns object object
20th Jul 2022, 12:36 AM
Varin
Varin - avatar
+ 1
Yes, we need to serialize an object to have it displayed in string form properly. console.log( JSON.stringify( letter_frequency( "hello" ) ) ); Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
20th Jul 2022, 3:27 AM
Ipang
+ 1
Ipang thanks it worked i was dying to get this function to work
20th Jul 2022, 3:38 AM
Varin
Varin - avatar