什么是栈和堆 栈和堆的主要作用存储变量,根据变量值得不同存储的位置也不同 在JS中,栈主要是存储基本类型的变量,包括String、Number、Boolean、Undefined、Null 和 对象类型的指针地址;堆主要用于存放对象类型的变量 假如有以下基本变量: let name = '胡三疯' let age = 18 let isMan = true let idCard = undefined let address = null let educationBackground = { scool:'hnsf', eduction:'硕士', specialty:'软件工程' }