Adrian Tache
Jul 31 · 1 min read

Coming from Javascript, I find it very weird (and dangerous) that destructuring takes into account the order of arguments in the constructor instead of the actual name of the variables. In my view the following should work the same, otherwise mistakes can be made:

val (first_name, last_name) = person
val (last_name, first_name) = person
    Adrian Tache

    Written by

    Mobile Developer 📱