Question from the Javascript test

Write a function that returns a string 'Haha!'

Hard

What does this javascript code do ?

function laugh(){
  return
  {
    ha: 'Haha!'
  }
}
laugh();
Author: Jean-marie CléryStatus: PublishedQuestion passed 2077 times
Edit
0
Community Evaluations
developer avatar
Stanley
26/07/2023
It returns undefined function laugh(){ return { ha: 'Haha!' } } laugh(); undefined
developer avatar
Auteur anonyme
18/08/2023
Hi Stanley, the question was simplified following your comment.
developer avatar
Sunny Jay Miner
29/01/2024
This is pretty tricky one. Most IDE's will auto correct it. line after return is ignored
developer avatar
Ludovic JIGAN
05/04/2024
Je me suis fait avoir ! Je suis d'accord avec Sunny vis à vis des IDE qui corrigent ce type d'erreur.