JavaScript函数参数查询
JavaScript是否接受多个字符串作为函数参数?
function name(Haydon Lyson){
//code
}
会接受吗?如果不是这样,我们如何将多个字符串作为函数参数传递。
Do javaScript accept multiple strings as a function parameter?
function name(Haydon Lyson){
//code
}
will it be accepted? If not then how can we pass multiple strings as function parameter.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以通过逗号将它们分开时将它们传递:
You can just pass them in separating them by comma:
将多个字符串作为函数参数可以完成两种方式之一。
首先是将字符串作为参数吸收并通过逗号将它们分开。
第二种方法是将对象传递到您的函数中,以便您能够将键值对操纵到您的功能中的字符串中,从而可以只有一个单个参数提供大量输入。
希望这有帮助!
Passing multiple strings as a function parameter can be done one of two ways.
The first is by taking in the strings as parameters and separating them by commas.
The second way is to pass in an object into your function so that you can have the ability to manipulate the key-value pairs into strings in your function, allowing for a massive amount of inputs with just one single parameter.
Hope this helps!