-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
Description
Docs contains good example:
class Person
constructor: (options) ->
{@name, @age, @height} = options
It's short and clear.
When I want to assign variables from object to locat variables it's work too:
{_name, _age, _height} = options
But If I want assign variables from one object to another I get error:
{obj.name, obj.age, obj.height} = options
I think It's not issue. But this fall short of expectations.
I suggest to add this functionality. I'm pretty much sure it's very useful.
For example in Angular:
{$scope.prevPage, $scope.nextPage} = response
Of couse I can use parallel assignment:
[$scope.prevPage, $scope.nextPage] = [response.prevPage, response.nextPage]
but it's longest and produced redundancy code.