JS笔记day01

1. vsftpd
    $apt-get install vsftpd
        修改配置文件
        /etc/vsftpd.conf
        31行
        write_enable=YES

    $ service vsftpd start
    $ service vsftpd status

2. node
    

3. 服务器( web开发工程师 )
    linux(centos / ubuntu)
    服务:
        apache2 (httpd)
        ssh 服务
        ftp 服务
        mysql 数据库服务
        lamn     linux + apache + mysql + node

        php     linux + apache + mysql +php

    手动安装
    1) 安装二进制文件 (安装包,二进制 bin)
        1. 下载node安装包
        2. 将node安装解压到/opt
            ~/opt/node-v8.11.4
        3. 配置环境变量
            全局
                /etc/profile
                追加
                    export 
            局部
                ~/.bashrc
                ~/.profile
    2) 通过源码安装
        linux默认集成python
        1. 下载源码 (无bin, configure)
        2. 安装前设置 
            ./configure --prefix...
        3. 编译
            make
        4. 安装
            make install

    html+css

4. 编程语言
    c语言
        编译语言
        hello.c无法直接运行在操作系统上
        编写-> 编译 ->运行(直接运行在操作系统上)

    Java语言(跨平台)
        编写-> 编译 ->运行(运行在jvm)

    js语言(nodeJS)
        编写 -> 运行

    1) js组成
        IE                             ies
        firefox                    ffs
        google chrome        gcs
        opera
        safari

        ECMAScript (ECMA)
            js语法标准
                变量
                数据类型
                关键字
                操作符
                语句(流程,循环)
                数组
                面向对象

                js开发者
                js解析者
        DOM (jquery)
            文档对象模型
            js语法标准开发出来的操作元素的js库
            var dom = document.getElementById()
            dom.onclick()
        BOM
            浏览器对象模式
            window.alert();
            confirm()
            prompt()
            setInterval()
            setTimeout()

    2) hello.js
        var str = "hello";
        console.log(str);

        $ node hello.js

    3) js注释
        // 单行注释
        /**/多行注释
        1:1 

        html注释 <!---->
        css注释    /**/

    4) 关键字和保留字
        var str = "hello"

    5) 变量
        可以变化的量
        js中的变量是弱类型的。变量的数据类型只有在初始化的时候才能被确定
        1. 弱类型
            var a ;        //undefined
            a = 3;         //number
            a = true     //boolean
            a = "19"     //string
            a = null     //null
        2. 变量声明
            var a ;
            var b , c;
        3. 初始化
            a = 3;
            b = true;

        4. 变量声明的提升
            console.log(e);    //undefined
            var e = 3;

            ->
            var e;    (声明提升)
            console.log(e);
            e = 3;
        5. 变量的数据类型
            1) 基本数据类型(5种)
                string
                    "true"     '1'
                number
                    1 1.1 

                    NaN (not a number)
                        isNaN(变量)
                        如果变量为NaN,那么返回true
                    Infinity
                        var a = 1/0;
                        无限大
                        isFinite(变量)
                        如果变量正常,返回true
                boolean
                    true / false
                undefined
                    未初始化
                    以undefined来初始化
                null
                    以null来初始化

                    function createPerson(name,age){
                        var person = null;
                        if(name && age){
                            person = new Object();
                            person.name = name;
                            person.age = age;
                        }
                        return person;
                    }

                    var p = createPerson("terry",22);
                    if(p == null){
                        console.log("未初始化");
                    } else {
                        console.log(p.name);
                    }


                判断变量所属数据类型
                    typeof 变量名

            2) 引用数据类型
                除了基本数据类型之外所有的其他数据类型都为引用数据类型

猜你喜欢

转载自blog.csdn.net/qq_36836332/article/details/81987918
今日推荐