const的用法

简介: const的用法
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
    <div id="app"></div>
    <script src="../vue.js"></script>
    <script>
        //被const修饰赋值后,不能修改
        //被const修饰必须赋值
        //常量的含义是指向的对象不能修改,但可以改变对象的属性
        const aaa = {
            name: "峰锅",
            age: 20,
            sex: "男"
        }
        aaa.name = "峰锅锅"
        console.log(aaa.name)
        console.log(aaa)
    </script>
</body>
</html>
目录
相关文章
|
1月前
|
编译器 C++
C++语言中const的用法
C++语言中const的用法
20 0
|
1月前
|
人工智能 安全 机器人
【C++】const_cast基本用法(详细讲解)
【C++】const_cast基本用法(详细讲解)
|
1月前
|
安全 编译器 C++
【C++中的const函数】何时与如何正确声明使用C++ const函数(一)
【C++中的const函数】何时与如何正确声明使用C++ const函数
31 0
|
1月前
|
安全 编译器 Linux
【C++中的const函数】何时与如何正确声明使用C++ const函数(二)
【C++中的const函数】何时与如何正确声明使用C++ const函数
36 0
|
1月前
|
安全 算法 编译器
【C++中的const函数】何时与如何正确声明使用C++ const函数(三)
【C++中的const函数】何时与如何正确声明使用C++ const函数
32 0
|
1月前
const的简单用法
const的简单用法
15 0
|
7月前
|
JavaScript 前端开发
let和const命令
let和const命令
35 0
|
存储 C语言 C++
【C++】const 用法总结(非常实用)
【C++】const 用法总结(非常实用)
|
JavaScript 前端开发
let与const命令
本文为猪痞恶霸学习阮一峰ES6标准入门的学习笔记 书中部分例子采摘于书籍
78 1