zoukankan      html  css  js  c++  java
  • Js枚举

    1、定义

    var Status = Object.freeze({
        "Connecting":0,
        "Ready":1,
        "Loading":2,
        "Processing": 3
    });

    2、使用

    console.log(Status.Ready)                      // 1
    console.log(Object.keys(Status)[Status.Ready]) // Ready                

    参考:https://zhuanlan.zhihu.com/p/79137838




    长风破浪会有时,直挂云帆济沧海!
    可通过下方链接找到博主
    https://www.cnblogs.com/judes/p/10875138.html
  • 相关阅读:
    HDU 1423
    POJ 3264
    POJ 3177
    CodeForces 81A
    SPOJ RATING
    ZOJ 2588
    POJ 1523
    POJ 3667
    递归
    数据结构
  • 原文地址:https://www.cnblogs.com/judes/p/15762641.html
Copyright © 2011-2022 走看看