javascript - Functions In CoffeeScript -
i'm trying convert function
javascript coffeescript. code:
function convert(num1, num2, num3) { return num1 + num2 * num3; }
but how can in coffeescript?
i'm trying run function html source this:
<script type="text/javascript" src="../coffee/convert.js"></script> <script type="text/javascript"> convert(6, 3, 10); </script>
but won't work , error saying: referenceerror: can't find variable: convert
how correct this?
you need export convert function global scope.
see how can coffescript access functions other assets?
window.convert = (num1, num2, num3) -> num1 + num2 * num3
Comments
Post a Comment