0
点赞
收藏
分享

微信扫一扫

Java 使用 poi 和 aspose 实现 word 模板数据写入并转换 pdf 增加水印

全栈顾问 2023-10-27 阅读 41

0031【Edabit ★☆☆☆☆☆】【使用箭头函数】Using Arrow Functions

data_structures language_fundamentals

Instructions
arrowFunc=(/*parameters*/)=>//code here
Examples
arrowFunc(3) // 3
arrowFunc("3") // "3"
arrowFunc(true) // true
Notes
  • N/A
Solutions
// create your arrow function below
arrowFunc = (parameter) => parameter ;
TestCases
let Test = (function(){
    return {
        assertEquals:function(actual,expected){
            if(actual !== expected){
                let errorMsg = `actual is ${actual},${expected} is expected`;
                throw new Error(errorMsg);
            }
        }
    }
})();


if(!(String(arrowFunc).includes('=>'))){
    Test.assertEquals(0,1,"Your code does not use an arrow function")
}

Test.assertEquals(arrowFunc(3),3)
Test.assertEquals(arrowFunc("3"),"3")
Test.assertEquals(arrowFunc(true),true)
Test.assertEquals(arrowFunc("test"),"test")
举报

相关推荐

0 条评论