参数的简单问题 [英] Simple problem with arguments

查看:49
本文介绍了参数的简单问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立了一个数组,现在我使用:

I built an array and now I use:

for(i=0; i< num; i++)
      loadNotes(texto[i]);

//字符串数组)


问题是,我的函数的标题应该是什么?

//array of strings)


The problem is, what should be the header of my functions?

function loadNotes(texto []) {



预先感谢.



Thanks in advance.

推荐答案

JavaScript中不需要类型信息

No type information is needed in JavaScript

for( i = 0; i <num; ++i)
  loadNotes( texto[i]);


function loadNotes( notes ){
  // use the notes variable
}


这将很简单:
It will be simply:
function loadNotes(texto){}


使用它时,您需要注意数组部分.


While using it you need to take care of array part.


for(i=0; i< num; i++)
      loadNotes(texto[i]);


function loadNotes(Val) {

 //your code
}


这篇关于参数的简单问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆