-
Notifications
You must be signed in to change notification settings - Fork 61
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
Array pattern destructuring not actually supported? #6
Comments
Sorry, I took another look at the document and saw at the bottom: "We look forward for tasty syntax sugar yet to come, such as rest and spread operators, destructuring "... |
No no, this is good. Thanks for posting. :) All examples should run in the latest Node. |
No problem then, I've been playing with harmony a lot lately and this resource is excellent. Though this feature is not currently present, it would appear that it is inbound in v8 |
Hi Justin, there is a mistake in given Fibonacci example. If n is 0 it is 0 (e.g. Ron Knott's Fib table). I share my code at jsbin.com for ES5 // iterative
function fibonacci (n) {
var i = 0,
temp = [i, i + 1];
for (i = 2; i <= n; i += 1) {
temp[i] = temp[i - 1] + temp[i - 2];
}
return (temp[n]);
}
// recursive one liner (very slow if n > 50 ! & bad to read)
function f (n) {
return ((n >= 2) ? f (n - 1) + f (n - 2) : n);
} |
@ronny-springer perhaps you should create a seperate issue for that so that it gets noticed. This issue has to do with destructuring syntax in general and not the fibonacci example per se... |
When demonstrating generators:
ReferenceError: Invalid left-hand side in assignment
I'm using node v0.11.13 with the --harmony flag.
The text was updated successfully, but these errors were encountered: