Object methods assigned to variables or function arguments fail when invoked

后端 未结 5 942
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-21 13:11

I\'m learning javascript right now, seems like beautiful functional language to me, it is wonderful move from PHP, I should have done this earlier. Although, I cannot figure

5条回答
  •  臣服心动
    2020-12-21 13:34

    I don't know if this is an acceptable solution, but you can do:

    v1 = function(exp) { return (/[abc]/).test(exp); }
    v1('a');
    

提交回复
热议问题