Comments (7)
Branch? File name?
from js-functions-ins-and-outs.
I'm guessing this: https://github.com/ga-wdi-boston/js-functions-ins-and-outs/blame/master/README.md#L84
from js-functions-ins-and-outs.
https://github.com/ga-wdi-boston/js-functions-ins-and-outs/blame/master/README.md#L98
This moves it from ins to both ins and outs. Avoid having them write functions that replace things in the objects passed.
from js-functions-ins-and-outs.
Like this?
const arrayTransform = function (values, predicate, mutator) {
// if the predicate is true, mutate the value, otherwise don't mutate it
let result = [];
for (let i = 0; i < values.length; i++) {
let value = values[i];
if (predicate(value)) {
result.push(mutator(value));
} else {
result.push(value);
}
}
return result;
};
from js-functions-ins-and-outs.
Yes, or like this, :-).
let result = new Array(values.length);
for (let i = 0; i < values.length; i++) {
result[i] = predicate(values[i]) ? mutator(values[i]) : values[i];
}
from js-functions-ins-and-outs.
Moved in readme, but not closing since I think this lesson needs to be refactored/split/something.
from js-functions-ins-and-outs.
Is it ok to continue this over in #12? If so, we can close this. Or, we can keep this open and close #12?
from js-functions-ins-and-outs.
Related Issues (20)
- README code is double wrong HOT 5
- Add scope to learning objectives, and add content about scope HOT 5
- PVD Thoughts (Did not deliver) HOT 3
- Did we lose a solution or demo branch? HOT 4
- Avoid mutating arguments to functions HOT 2
- Maintain code in one place
- Solution Branch needs to mirror Master HOT 1
- Remove profanity HOT 3
- more clear definition of the different types of functions? HOT 3
- Debugging Variable Scope Code Along should be in bin to run with node HOT 1
- Function Add should + not -
- Replace `unlimited` with `arbitrary`
- JS file names should be hyphenated not underscored
- Annotate use of `num` as variable and as parameter HOT 1
- `honesty_lab` file should match README code
- Remove code from README HOT 1
- Honest Lab is too negative. We need a better example.
- Typo memofactory must be memoFactory
- Code along example is broken HOT 1
- The memo example is wrong, or I don't understand the intent. Help? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-functions-ins-and-outs.