const

const

Declares a constant with block level scope

Spec http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations
Status Other
IE Edge Firefox Chrome Safari Opera
    57 62    
    56 61 TP 48
  16 55 60 11 47
11 15 54 59 10.1 46
10 14 53 58 10 45
9 13 52 57 9.1 (2,3) 44
8 12 51 56 9 (2,3) 43
Show all
7   50 55 8 (2,3) 42
6   49 54 7.1 (2,3) 41
5.5   48 53 7 (2,3) 40
    47 52 6.1 (2,3) 39
    46 51 6 (2,3) 38
    45 50 5.1 (2,3) 37
    44 49 5 (2) 36
    43 48 (4) 4 (2) 35 (4)
    42 47 (4) 3.2 (2) 34 (4)
    41 46 (4) 3.1 (2) 33 (4)
    40 45 (4)   32 (4)
    39 44 (4)   31 (4)
    38 43 (4)   30 (4)
    37 42 (4)   29 (4)
    36 41 (4)   28 (4)
    35 (2) 40 (2,3)   27 (2,3)
    34 (2) 39 (2,3)   26 (2,3)
    33 (2) 38 (2,3)   25 (2,3)
    32 (2) 37 (2,3)   24 (2,3)
    31 (2) 36 (2,3)   23 (2,3)
    30 (2) 35 (2,3)   22 (2,3)
    29 (2) 34 (2,3)   21 (2,3)
    28 (2) 33 (2,3)   20 (2,3)
    27 (2) 32 (2,3)   19 (2,3)
    26 (2) 31 (2,3)   18 (2,3)
    25 (2) 30 (2,3)   17 (2,3)
    24 (2) 29 (2,3)   16 (2,3)
    23 (2) 28 (2,3)   15 (2,3)
    22 (2) 27 (2,3)   12.1 (1,3)
    21 (2) 26 (2,3)   12 (1,3)
    20 (2) 25 (2,3)   11.6 (1,3)
    19 (2) 24 (2,3)   11.5 (1)
    18 (2) 23 (2,3)   11.1 (1)
    17 (2) 22 (2,3)   11 (1)
    16 (2) 21 (2,3)   10.6 (1)
    15 (2) 20 (2)   10.5 (1)
    14 (2) 19 (2)   10.0-10.1 (1)
    13 (2) 18 (2)   9.5-9.6
    12 (1) 17 (2)   9
    11 (1) 16 (2)    
    10 (1) 15 (2)    
    9 (1) 14 (2)    
    8 (1) 13 (2)    
    7 (1) 12 (2)    
    6 (1) 11 (2)    
    5 (1) 10 (2)    
    4 (1) 9 (2)    
    3.6 (1) 8 (2)    
    3.5 (1) 7 (2)    
    3 (1) 6 (2)    
    2 (1) 5 (2)    
      4 (2)    
iOS Safari Opera Mini Android Browser Blackberry Browser Opera Mobile Android Chrome Android Firefox IE Mobile Android UC Browser Samsung Internet QQ Browser Baidu Browser
11                      
10.3 all (1,3) 56 10 (2,3) 37 59 54 11 11.4 (2,3) 5 1.2 (2,3) 7.12 (4)
10.0-10.2   4.4.3-4.4.4 (2,3) 7 (2,3) 12.1 (1,3)     10   4 (4)    
9.3 (2,3)   4.4 (2,3)   12 (1,3)              
9.0-9.2 (2,3)   4.2-4.3 (2,3)   11.5 (1)              
Show all
8.1-8.4 (2,3)   4.1 (2,3)   11.1 (1)              
8 (2,3)   4 (2,3)   11 (1)              
7.0-7.1 (2,3)   3 (2,3)   10 (1)              
6.0-6.1 (2,3)   2.3 (2)                  
5.0-5.1 (2,3)   2.2                  
4.2-4.3 (2)   2.1                  
4.0-4.1 (2)                      
3.2 (2)                      

Notes

  1. const is recognized, but treated like var (no block scope, can be overwritten)

  2. const does not have block scope

  3. Only recognized when NOT in strict mode

  4. Supported correctly in strict mode, otherwise supported without block scope

Resources

Data by caniuse.com
Licensed under the Creative Commons Attribution License v4.0.
http://caniuse.com/#feat=const

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部