@maurobringolf
Undergraduate student of computer science interested in compilers, formal methods and logic. Writing regularly on https://maurobringolf.ch .
Nothing here yet.
Nothing here yet.
No blogs yet.
The outer return statement return array.filter((item) => { says that reject returns the result of this filter call. This will be an array. The inner return statement return !iteratorFunction(item) says that the filtering function should use the value !iteratorFunction(item) as criterion for filtering, e.g. keep only those values for which this evaluates to true . A return statement only affects the closest surrounding function.
This is correct behaviour and the key to understanding it is two's complement representation of signed integers. @cutecutdown This code at the end of your answer seems a bit misleading since JavaScript does not have 64 bit integers. Bitwise operators only work on 32 bit integers, but even those are converted from doubles which is the only number type defined by the language. I gathered and summarized lots of information on numbers in JavaScript in two blogposts covering integers, two's complement and bitwise operators: https://maurobringolf.ch/2018/01/js-numbers-bitwise-operators/ https://maurobringolf.ch/2018/01/js-numbers-there-are-no-integers-but-how-many/ Hope that helps
From my experience, most of the big projects in the JavaScript ecosystem are very welcoming to first time contributors. To make your first "valuable" contribution I'd suggest you pick a project that you are using yourself. Read documentation and turn on notifications for issues on GitHub and very quickly you will realize that a lot of people make small yet valuable contributions (documentation, small refactoring etc) without knowing all the details of the source code. At least that has been my experience so far. Last year when my first "feature code" pull request was merged, I wrote a post about the experience: https://maurobringolf.ch/2017/07/open-source-9-steps-to-my-first-feature-contribution-in-babel/ Although thats more geared towards contributing long-term rather than just one small first contribution, but maybe it helps anyway.