网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
( 难度:中等)下列哪种是正定义javascript 方法的正确方式
A.var funName = function(){}
B.function funName (){}
C.var funName = new function(){}
D.var funName = new Function("x,y",".alert(x+y)");
A.var funName = function(){}
B.function funName (){}
C.var funName = new function(){}
D.var funName = new Function("x,y",".alert(x+y)");
参考答案
更多 “( 难度:中等)下列哪种是正定义javascript 方法的正确方式A.var funName = function(){}B.function funName (){}C.var funName = new function(){}D.var funName = new Function("x,y",".alert(x+y)");” 相关考题
考题
JavaScript中定义一个求两个整数较大数函数的正确形式是()。A.function:max(intx,inty){}B.function=max(x,y){}C.functionintmax(intx,inty){}D.functionmax(x,y){}
考题
下列程序运行后,单击命令按钮,窗体显示的结果为( )。 Private Function pl(x As Integer,y As Integer,z As Integer) pl=2*x+y+3*z End Function Private Function p2(X As Integer,y As Integer,z As Integer) p2=p1(z,y,x)+x End Function Private Sub Commandl_Click()A.23B.19C.21D.22
考题
(27)窗体上有两个文本框Text1、Text2以及一个命令按钮Commandl,编写下列程序: Dim y As Integer Private Sub Command1_Click() Dim x As Integer x=2 Text1Text=p2(p1(x),y) Text2Text=p1(x) End Sub Private Function pl(x As Integer) As Integer x=x+y:y=x+y pl=x+y End Function Private Function p2(x As Integer,By Val y As Integer) p2=2*x+y End Function 当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为 A.2 4 2 4 B.2 44 8C.4 4 8 8 D.10 1058 58
考题
(30)窗体上有两个文本框Text1、Text2以及一个命令按钮Commandl,编写下列程序: Dim y As Integer Private Sub Commandl_Click() Dim x As Integerx=2 Text1.Text=p2(pl(x),y) Text2.Text=p2(x) End Sub Private Function p2(x As Integer,y As Integer) x=x+y:y=x+y pl=x+y End Function Private Function p2(x As Integer,y As Integer)As Integer p2=2*x+y End Function 当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为( )。A.2 4 B.2 4 C.4 4 D.10 10 2 4 4 8 8 8 58 58
考题
声明一个对象,给它加上name属性和show方法显示其name值,以下代码中正确 的是( )。
Avarobj = [name:"zhangsan",show:function(){alert(name);}];Bvarobj = {name:"zhangsan",show:”alert()”};Cvarobj = {name:"zhangsan",show:function(){alert(name);}};Dvarobj = {name:"zhangsan",show:function(){alert();}};
考题
对于函数原型void function(int x,float y,char z='a'),合法的函数调用是( )。A.function(2,3.Of)B.function(2,3,4)C.function(2)D.function()
考题
窗体上有两个文本框Text1、Text2以及一个命令按钮Comanand1,编写下列程序: Dim y As Integer Private Sub Command1_Click() Dim x As Integer x=2 Text1.Text = p2(p1(x), y) Text2.Text = p1(x) End Sub Private Function p1(x As Integer) As Integer x=x+y:y=x+y p1=x+y End Function Private Function p2(x As Integer, y As Integer) As Integer p2=2*x+y End Function 当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为( )。A.2 4 2 4B.2 4 4 8C.4 4 8 8D.10 10 58 58
考题
窗体上有Text1、Text2两个文本框及一个命令按钮Command1,编写下列程序 Dim y As Integer Private Sub Command1_Click() Dim x As Integer X=2 Text1.Text=Fun2(Fun1(x),y) Text2.Text=Fun1(x) End Sub Private Function Fun1(x As Integer)As Integer x=x+y:y=x+y Fun1=x+y End Function Private Function Fun2(x As Integer,y As Integer)As Integer Fun2=2*x+y End Function 当单击1次和单击2次命令按钮后,文本框Textl和Text2内的值分别是A.2 4 2 4B.2 4 4 8C.10 10 58 58D.4 4 8 8
考题
JavaScript 中定义一个求两个整数较大数函数的正确形式是( )。
A.function: max(int x,int y){}
B.function = max(x,y){}
C.function int max(int x,int y){}
D.function max(x,y){}
考题
JavaScript中定义一个求两个整数较大数函数的正确形式是( )。A.function:max(int x,int y){}
B.function=max(x,y){}
C.function int max(int x,int y){}
D.function max(x,y){}
考题
以下哪段代码不能正确创建函数show()?()A、function show(text){ alert(text); }B、var showFun = function show(text){ alert(text); }C、var showFun = function(text){ alert(text); }D、var showFun =new function("text" , "alert(text)"};
考题
Javascript中, 以下代码运行后变量y的值是:() var x = [‘abcde’ , 123456]; var y = typeof typeof x[1];A、"function"B、"object"C、"number"D、"string"
考题
当单击段落元素时显示它的文本内容,以下哪句可以实现该功能?()A、$("p").on("click",function(){alert($(this).text())})B、$("p").on("onclick",function(){alert($(this).text())})C、$("p").on("click",function(){alert(this.text())})D、以上都不正确
考题
单选题当单击段落元素时显示它的文本内容,以下哪句可以实现该功能?()A
$(p).on(click,function(){alert($(this).text())})B
$(p).on(onclick,function(){alert($(this).text())})C
$(p).on(click,function(){alert(this.text())})D
以上都不正确
考题
单选题以下哪段代码不能正确创建函数show()?()A
function show(text){ alert(text); }B
var showFun = function show(text){ alert(text); }C
var showFun = function(text){ alert(text); }D
var showFun =new function(text , alert(text)};
考题
( 难度:中等)下列声明数组的语句中,错误的选项是()A.Var arry= new Array()B.Var arry=new Array(3)C.Var arry[]=new Array(3)(4)D.Var arry=new Array("3","4")
考题
( 难度:中等)Javascript 中, 以下那两个变量的值不是==:()A.var a=0 , b=-0;B.var a=NaN , b=NaN;C.var a=null ,b=undefined;D.var a=[] , b=false;
考题
( 难度:中等)下列创建数组的语句正确的是:A.var arr = [];B.var arr = [1.1, true, “abc”];C.var arr = new Array();D.var arr = new Array(1);E.var arr = new Array(1,2,3);
考题
( 难度:中等)下列定义名为fun 的函数语法正确的是:A. functionfun(a){alert(a);}B. varfun=function(a){alert(a);}C. varfun=newFunction(“a”,”alert(a);”);D. varfun=Function(“functionfun(a){alert(a);}”);
热门标签
最新试卷