-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return packed array #4156
Return packed array #4156
Conversation
This is also well-aligned with math functions like Can you update reference doc, update CHANGES.md, and add full unit tests? |
@pjcozzi updated CHANGES.md and added doc I think all classes that have |
@@ -14,7 +14,8 @@ define([ | |||
|
|||
it(namePrefix + ' can pack', function() { | |||
var packedArray = []; | |||
packable.pack(instance, packedArray); | |||
packedArray = packable.pack(instance, packedArray); | |||
expect(packedArray).toBeDefined(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than re-assigned packagedArray, create a new variable called returnedArray
and do expect(returnedAraray).toBe(packedArray)
in order to verify that's what is actually returned.
Except for that one comment, this is fine with me. Thanks, @hpinkos! |
Thanks @mramato! Updated |
This make all
pack
functions return the packed array. This helpful if I want to do something likeI also think it's all around more intuitive. I know we do this a lot, but to me this syntax is weird
And this makes much more sense