首页 > 解决方案 > 在hackerrank解决方案平台上用ECMAscript 6编写箭头函数程序时出现错误

问题描述

问题 - 编写一个程序,将输入作为 your_name 并返回 hello your_name

我的程序 -

Const.greet = (your_name) => {

返回('你好'+你的名字);

};

module.exports ={问候}

标签: javascriptarrow-functionsecma

解决方案


检查此代码

const greet = (your_name) => {

return ('Hello' + your_name);

};
console.log(greet('ab'))

推荐阅读