Replacing the console.log with return