# bring strict type into javascript / ecmascript

**URL:** <https://es.discourse.group/t/bring-strict-type-into-javascript-ecmascript/1180>\
**Category:** 🦋 Proposals\
**Created:** [January 27, 2022, 1:42pm UTC](https://es.discourse.group/t/bring-strict-type-into-javascript-ecmascript/1180 "2022-01-27T13:42:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![theScottyJam](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/thescottyjam/32/616_2.png) [@theScottyJam](https://es.discourse.group/u/theScottyJam)\
**Post date:** [January 27, 2022, 3:02pm UTC](https://es.discourse.group/t/bring-strict-type-into-javascript-ecmascript/1180/2 "2022-01-27T15:02:47Z")

</div>

There's been a handful of different discussions around this idea on this form, so if you want to read up a bit on prior discussion, you can do a [quick search for "type"](https://es.discourse.group/search?q=type) and click on anything that sounds interesting. In particular, [this thread](https://es.discourse.group/t/type-fixing/918) proposes a somewhat similar idea, about adding support to set variables to specific types.

I would like to ask for a bit of clarification on your idea. If I write this code:

```javascript
function doThing(String myStr) { ... }
doThing(2)

```

Is this a runtime error? Or a loadtime error? Or both (it checks for type errors at loadtime, and at runtime, in case it missed anything)?

Also, sorry, I have to nitpick a bit - CoffeeScript didn't actually provide any type-related features, it was merely an alternative syntax for JavaScript (it provided things like class syntax and optional chaining long before JavaScript had them)

---

_[View the full topic](https://es.discourse.group/t/bring-strict-type-into-javascript-ecmascript/1180)._
