zoukankan      html  css  js  c++  java
  • Javascript基础1

    1.数据类型:null和undefined区别?

      undefined是指原生类型没有定义,而null是指对象没定义.

    2.数组声明:['a',3,'hello',true];

    3.控制结构:for(var i=0; i<test.length; i++){//...........}

      如果对象:var obj = {name:'aa',age:23};

      for(var k in obj){console.log(k+obj[k]);}

    4.对象操作:

      str.length;  str.substr(2,3);   

      var aa =['a','b','c','d'];

      var bb = 'a,b,c,d,e';

      对象合并为字符串:aa.join(',');

      字符串分解为对象:bb.split(',');

      返回字符串出现的位置:indexOf(string);

      toLowerCase//toUpperCase//replace(str1,str2);

      日期对象:

      getFullYear();//

      getMonth()//

      getDate();

      getHours();

      getMinutes();

      getSeconds();

      getMilliseconds();

      Math数学对象:

      ceil(..);  //    >=此数的最小整数.

      floor(..)//   <=此数的最大整数

      min(d1,d2,d3);返回最小值

      max(d1,d2,d3);

      random();返回随机数

    window内置对象

      window.navigator

      window.location 地址栏对象

      window.history  历史记录

        window.history.forward();

        window.history.back();

      window.screen  屏幕对象

      window.screen.width  获取屏幕宽度

      window.document  文档对象

  • 相关阅读:
    读书笔记2
    实验8 SQLite数据库操作
    实验7 BindService模拟通信
    实验6 在应用程序中播放音频和视频
    实验5 数独游戏界面设计
    网络工程201306114136张文雅实验四
    实验五 操作系统之存储管理
    实验四 主存空间的分配和回收
    进程调度模拟程序
    作业调度算法
  • 原文地址:https://www.cnblogs.com/bing2017/p/7575587.html
Copyright © 2011-2022 走看看