做类似的事情:
speak('Hello. Today is " + month + "/" + day + "/" + year + ", " + hours + ":" + minutes + ". I have couple suggestions of what to do today...Wanna go to the movies? Play some games? Go out to eat? Need anything else?')
当它写下它们时,它的字面意思是" + month + "/" + day + "/" + year + ", " + hours + ":" + minutes + "
speak('')
是另一个脚本定义的函数。是否可以在其中放入变量?
最佳答案
这是因为单引号和双引号交替出现。您想选择一种并持续使用它。两种风格都可以(所有单打或所有 double ),但都不是首选,所以这是您的选择。
关于javascript - 在 JavaScript 中调用一个带有变量的函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16595821/