How to run prelude functions

瘦欲@ 提交于 2019-12-13 17:51:06

问题


I downloaded prelude.js and added it in my application. I linked the js file in my html file in the following way:

<script type="text/javascript" src="prelude-browser-min.js"></script>

I didn't link any dependent file in my html file. I opened the browser console and ran the following code, which is not working:

tail [1 to 5]

It looks like I'm not able to see the prelude function.

So do I need to add any other file in my html headers ? What am I doing wrong ?


回答1:


That's livescript syntax, but if you want to use vanilla js; here's a jsfiddle setup.

var prelude = require('prelude-ls')
tail = prelude.tail([1,2,3,4,5])
console.log(tail);


来源:https://stackoverflow.com/questions/20382364/how-to-run-prelude-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!