underscore.string下载正确引用后为什么会报错,非node方式

<meta charset="utf-8"/>

<script src="../underscore.js"></script>

<script src="../underscore.string.js"></script>

<script src="../jquery.js"></script>

<script src="../backbone.js"></script>

<script>

//TypeError: _(...).chain(...).trim is not a function

    console.log(_("   epeli  ").chain().trim().capitalize().value());

</script>


BIG阳
浏览 535回答 3
3回答

开心每一天1111

var test = "&nbsp; &nbsp;this is a test&nbsp; &nbsp; ";console.log(test);&nbsp; &nbsp; // "&nbsp; &nbsp;this is a test&nbsp; &nbsp; "test = _.str.trim(test);console.log(test);&nbsp; &nbsp; // "this is a test"test = _.str.capitalize(test);console.log(test);&nbsp; &nbsp; // "This is a test"
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript