zoukankan      html  css  js  c++  java
  • JavaScript class 使用

    /*********************************************************************
     *                     JavaScript class 使用
     * 说明:
     *     Javascript类的写法有多种,不过不打算用那些传统方法,使用语法糖class
     * 来直接解决,能简单的那就不用复杂的。
     *
     *                                   2017-8-25 深圳 龙华樟坑村 曾剑锋
     ********************************************************************/
    
    一、参考文档:
        1. 继承与原型链
            https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Inheritance_and_the_prototype_chain
        2. 语法糖
            https://zh.wikipedia.org/wiki/%E8%AF%AD%E6%B3%95%E7%B3%96
        3. Javascript定义类(class)的三种方法
            http://www.ruanyifeng.com/blog/2012/07/three_ways_to_define_a_javascript_class.html
        4. 深入浅出ES6(十三):类 Class
            http://www.infoq.com/cn/articles/es6-in-depth-classes
        5. Classes (ES6) Sample
            https://googlechrome.github.io/samples/classes-es6/
    
    二、参考代码:
        1. 请参考《Classes (ES6) Sample》中的代码。
        2. 最简单的demo:
            class Zengjf_utils {
                constructor() {
                    console.info("Zengjf");
                }
                ...
            }
    
            class ZengjfOS extends Zengjf_utils{
                constructor() {
                    super()
                    console.info("ZengjfOS");
                }
                ...
            }
  • 相关阅读:
    terraform入门操作指南
    linux常用命令
    pssh用法范例
    nginx共享内存使用
    Redis监控指标[转]
    xargs用法笔记
    systemd用法记录一
    esxcli部分常用命令
    lua自定义功能模块table类型转string类型
    curl用法笔记
  • 原文地址:https://www.cnblogs.com/zengjfgit/p/7442370.html
Copyright © 2011-2022 走看看