[英]Uppercase an array of strings with Ramda
我正在尝试使用Ramda来使点函数变为大写的字符串数组,但是我对此并不陌生 ,并且无法解决 。
const list = ['a', 'b', 'c', 'd', 'e']
const fn = R.compose(R.toUpper, R.map)
console.log('result', fn(list))
让我Uncaught TypeError: function n(r){return 0===arguments.length||w(r)?n:t.apply(this,arguments)} does not have a method named "toUpperCase"
我也尝试过
const fn = R.compose(R.toUpper, R.map(list))
console.log('result', fn())
但得到同样的错误。
如何使用Ramda做到这一点?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.