Can I use ES6’s arrow function syntax with generators? (arrow notation)

Can I use ES6’s arrow function syntax with generators? You can’t. Sorry. According to MDN The function* statement (function keyword followed by an asterisk) defines a generator function. From a spec document (my emphasis): The function syntax is extended to add an optional * token: FunctionDeclaration: “function” “*”? Identifier “(” FormalParameterList? “)” “{” FunctionBody “}”

Is there a difference between continue and pass in a for loop in Python?

Yes, they do completely different things. pass simply does nothing, while continue goes on with the next loop iteration. In your example, the difference would become apparent if you added another statement after the if: After executing pass, this further statement would be executed. After continue, it wouldn’t. >>> a = [0, 1, 2] >>> … Read more

How do I remove javascript validation from my eclipse project?

I actually like MY JavaScript files to be validated, but I definitely don’t want to validate and deal with trivial warnings with third party libraries. That’s why I think that turning off validation all together is too drastic. Fortunately with Eclipse, you can selectively remove some JavaScript sources from validation. Right-click your project. Navigate to: … Read more

In Ruby, how do I skip a loop in a .each loop, similar to ‘continue’ [duplicate]

Use next: (1..10).each do |a| next if a.even? puts a end prints: 1 3 5 7 9 For additional coolness check out also redo and retry. Works also for friends like times, upto, downto, each_with_index, select, map and other iterators (and more generally blocks). For more info see http://ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html#UL.