zoukankan      html  css  js  c++  java
  • 9.12

    1. js 的六种基本数据类型?

     ES5 中的基本数据类型有 5 种:Undefined、Null、Boolean、Number、String.而 Object 是属于复杂数据类型,所以我认为这里说的 6 种基本数据类型是指:Undefined、Null、Boolean、Number、String 与 Symbol.

    2.

    arr.shift()删除数组第一个元素

    arr.push()从数组的最后面加元素

    arrr.unshift() 冲数组的最前面加元素

    arr.concat() 复制原来数组生成新数组然后在后面加上()里面的元素

    3.以下哪些选项可以获取ID为a的DOM元素?

    document.getElementById('A')

    document.querySelector('#a')返回文档中匹配指定 CSS 选择器的一个元素。
    所以要获取ID为a的DOM元素,需要加上#+id名。也就是document.querySelector("#a");

    4.页面有一个按钮button id为 button1,通过原生的js如何禁用?(IE 考虑IE 8.0以上版本)

    document.getElementById("button1").disabled = true;

    document.getElementById("button1").setAttribute(“disabled”,”true”);

    5.下面哪些属于JavaScript的typeof运算符的可能结果:()

    typeof Symbol()    //"symbol"
    typeof Number()    //"number"
    typeof String()    //"string"
    typeof Function()    //"function"
    typeof Object()    //"object"
    typeof Boolean()    //"boolean"
    typeof null    //"object"
    typeof undefined    //"undefined"
     
     

    typeof Symbol() //" symbol"

    typeofNumber()//‘number’

    typeofString()//‘string’

    typeofFunction()//‘function’

    typeof Object()//object

    typeof null //object

    typeof bollean() //boolean

    typeof undefinded //undefinded

  • 相关阅读:
    HTML5入门5---HTML5控件元素
    HTML5入门4---HTML5 与 HTML4 同一网页的不同写法
    HTML5入门3---视频播放器
    HTML5入门2---js获取HTML元素的值
    JTable指定单元格加控件
    JTable单元格放自定义控件(一)-如何在JTable的单元格放JPanel
    数据库外键的使用
    LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
    mvn 安装ojdbc6.jar
    Apache 下SVN项目管理使用说明
  • 原文地址:https://www.cnblogs.com/smhyu/p/13656603.html
Copyright © 2011-2022 走看看