# About CreateMutable Binding in Global Environment Record

**URL:** <https://es.discourse.group/t/about-createmutable-binding-in-global-environment-record/2036>\
**Category:** Spec Reading\
**Created:** [May 19, 2024, 6:45am UTC](https://es.discourse.group/t/about-createmutable-binding-in-global-environment-record/2036 "2024-05-19T06:45:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sourish-Mukherjee](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/sourish-mukherjee/32/2090_2.png) [@Sourish-Mukherjee](https://es.discourse.group/u/Sourish-Mukherjee)\
**Post date:** [May 19, 2024, 6:45am UTC](https://es.discourse.group/t/about-createmutable-binding-in-global-environment-record/2036/1 "2024-05-19T06:45:41Z")

</div>

Hi everone :) !

Currently Reading April 2024 version,

So I am new to reading ecmascript, and was going through ER (environment records), i was reading the GER( Global Enviroment Record) (9.1.1.4.2) ~ createMutableBinding.

The method createMutableBindingwhich is implemented in GER has following steps

1. Let DclRec be envRec.[[DeclarativeRecord]].
2. . If ! DclRec.HasBinding(N) is true, throw a TypeError exception.
3. Return ! DclRec.CreateMutableBinding(N, D).

Why is ecma suggesting to throw type error ? if DclRecord doesnt get binding ?

The function is createmutable Record, shouldnt it be actually be like this, if declHasBinding (n) true , then type error ?  
Why is ! operator here ? Can someone please clarify these steps ?

Link -\> [ECMAScript® 2025 Language Specification (tc39.es)](https://tc39.es/ecma262/#sec-global-environment-records)

---

<div class="post-metadata">

**Author:** ![aclaymore](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/aclaymore/32/501_2.png) [@aclaymore](https://es.discourse.group/u/aclaymore)\
**Post date:** [May 19, 2024, 7:00am UTC](https://es.discourse.group/t/about-createmutable-binding-in-global-environment-record/2036/2 "2024-05-19T07:00:31Z")

</div>

`!` in the algorithms does not mean negation. It's short hand for ReturnIfAbrupt`:

[https://tc39.es/ecma262/multipage/notational-conventions.html#sec-returnifabrupt-shorthands](https://tc39.es/ecma262/multipage/notational-conventions.html#sec-returnifabrupt-shorthands)

I will admit my brain does struggle with this syntax after so much conditioning to interpret it as a NOT, but gets easier after a while

---

<div class="post-metadata">

**Author:** ![Sourish-Mukherjee](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/sourish-mukherjee/32/2090_2.png) [@Sourish-Mukherjee](https://es.discourse.group/u/Sourish-Mukherjee)\
**Post date:** [May 19, 2024, 7:06am UTC](https://es.discourse.group/t/about-createmutable-binding-in-global-environment-record/2036/3 "2024-05-19T07:06:13Z")

</div>

Oh sure thanks for the help
