以下选项,能够正确随机获取数组中元素的是 var arr = [“张三”,“李四”,“王二”,“二哈”]【AB】 A Math.round(Math.random() * (arr.length-1) ) B parseInt(Math.random() * arr.length ) C Math.round(Math.random() * (arr.length) ) D parseInt(Math.random() * (arr.length-1) )
以下函数中,哪些是在调用后,原数组本身也被改变,不返回新数组?【ABCD】 A push() B pop() C shift() D unshift()
关于nodeValue描述错误的是?【C】 A 属性节点的nodeValue是属性值 B 文本节点的nodeValue是文本本身 C 元素节点的nodeValue是数字 D 元素节点的nodeValue是标签名
JS提供的定时器有哪些?【AC】 A setInterval() B clearInterval() C setTimeout() D clearTimeout()
window对象的子对象有?【ABD】【还有一个screen】 A document B location C href D history
下列哪些方法可以遍历数组?【ABC】 A for B for-in C do-while D for-by
以下哪些操作可以刷新浏览器?【AB】 A window.history.go(0) B window.location.reload() C window.open() D window.history.back(0)
在JavaScript中,可以实现跳转的是?【ABCD】 A window.open() B window.location.href C window.location.assign() D window.location
下列哪些是属于DOM操作的方法?【BD】 A removeChildren B appendChild() C children D removeChild()
下面结果返回值为4的有?【ABD】 A Number(“4”) B parseInt(“4aa11”) C Math.floor(3.5) D Math.round(3.5)
对象可以通过哪种方式进行对象属性的遍历?【C】 A forEach B for C for…in D for…of
Math.floor( -3.5 )结果为?-4
请阅读下面代码 var num = Math.floor(Math.random()*100); 上述代码中num的取值范围是?0-99
JS获取数组有多少个值?length
var arr = [5,3,2,4]; var res = arr.splice(0); console.log(res) 结果是?5,3,2,4
var bool = true; setTimeout(function(){ bool = false },0); console.log(bool)true
已知当前的系统时间,var now = new Date(),设置3天后的时间正确写法是?【AC】 A now.setDate(now.getDate()+3) B now.setTime(now.getTime()+3) C now.setTime(now.getTime()+31000360024) D now.setDate(now.getDate()+31000360024)
以下返回结果为类数组对象的语句为?【BD】 A document.getElementById() B document.getElementsByClassName() C document.querySelector () D document.querySelectorAll()
在Javascript中,关于window对象描述不正确的是?【D】 A window.history属性是指有关客户访问过的URL信息 B window.confirm( )方法显示一个带有提示信息和确认及取消按钮的警示框 C window.prompt( )方法用于显示可提示用户进行输入的对话框 D window.onload 事件会在窗口或框架被调整大小时发生。
节点的nodeType值是什么,代表着是元素节点?1
添加节点的方法? appendChild() insertBefore()
两个字符大小比较规则是什么?ASCII
以下代码执行后,哪个结果是正确的 var str = “hello world”; console.log( str. substring(2,7) )llo w
下面哪些方式可以将div的文字设置为红色?【BC】 A div.color = “red” B div.style.color =“red” C div.style.cssText=“color:red” D div.cssText=“red”
可以通过哪种方式改变元素obox的样式 或 class名?【AB】 A obox.style.color=“red” B obox.className=“active” C obox.color=“red” D obox.style.className=“active”
var arr = [how,are,you]; arr.reverse(); alert(arr)【B】 A how,are,you B you,are,how C h,o,w,a,r,e,y,o,u D u,o,y,e,r,a,w,o,h
日期对象设置年月日的方法有?【AD】 A setFullYear B setYear C setDay D setDate
var str = “abcdfghi”; 下面哪些方式可以实现截取"bcd"【AB】 A str.substr(1,3) B str.substring(1,4) C str.substring(1,3) D str.substr(1,4)