オブジェクトを不変にする(シャロー)
const config = Object.freeze({ host: 'localhost', port: 3000 });
config.host = 'other'; // 無視される(strictではTypeError)
Object.isFrozen(config); // true
// ネストは凍結されない(シャロー)
const obj = Object.freeze({ nested: { x: 1 } });
obj.nested.x = 99; // 変更できてしまう!ネストしたオブジェクトは凍結されないため深い不変性にはimmerなどを使う。定数オブジェクトの保護に有用。