Share your repls and programming experiences

← Back to all posts
StronglyTyped variables in JS
h
pavi2410 (36)

StronglyTyped is an experiment to introduce strong-typed variables to JS. Its goal is to offer type safety through the direct use of pure JS syntax. It uses Proxy to make this magic happen!

Syntax

  • Declare a typed variable
let var_name = mutableVar(type, value)
  • Access the value
var_name._
  • Mutate the variable
var_name._ = some_value

Known Limitations

  • I have only tested it using primitives. I am not sure whether it works for Objects.