赞
踩
- var array1 = [1,2,3,"js",4,true,"hello"];
- var array2 = [true,true,"java",2.1];
- function mainJs(a) {
- //请在此处编写代码
- a = parseInt(a);
- /*********begin*********/
- b = array1.length;
- c = array2.length;
- if (a == b) return (array1[b-1]);
- else return (array2[c-1]);
-
- /*********end*********/
- }
- var testArray = [12,"java","js","c","c++",24,36,"python","c#","css"];
- function mainJs(a, b) {
- a = parseInt(a);
- b = parseInt(b);
- //请在此处编写代码
- /*********begin*********/
- for (i = 0; i < a; i++){
- c = testArray.pop();
- testArray.unshift(c)
- }
- return (testArray[b]);
-
-
- /*********end*********/
- }
- function mainJs(myArray) {
- myArray = myArray.split(",");
- //请在此处编写代码
- /*********begin*********/
- var x = new Array();
- var y = new Array();
- var l = myArray.length;
- var i = 0;
- while (i < l) {
- i = myArray.indexOf("a", i);
- if (i ==-1) break;
- x.push(i);
- i++;
- }
- i = 0;
- while (i < l) {
- i = myArray.indexOf("b", i);
- if (i ==-1) break;
- y.push(i);
- i++;
- }
- return (x.concat(y));
-
- /*********end*********/
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。