codesmithllc / cs-bin-solutions Goto Github PK
View Code? Open in Web Editor NEWSolution code to CS Bin Challenges
Solution code to CS Bin Challenges
Hello,
I started following your course and correct me if I'm wrong but the function intersection
expects one parameter arrays
which should be of type array.
However in your comment written just below the challenge 7, you pass in 3 arguments.
cs-bin-solutions/functional.js
Line 74 in 20de7d4
I think you might have intended to write:
// console.log(intersection([[5, 10, 15, 20], [15, 88, 1, 5, 7], [1, 10, 15, 5, 20]]));
On a side not, thanks, I quite enjoy the course so far.
// Challenge 7
const intersection = (arrays) => {
return arrays.reduce((acc, curr) => {
return curr.filter(el => acc.includes(el));
});
};
// console.log(intersection([5, 10, 15, 20], [15, 88, 1, 5, 7], [1, 10, 15, 5, 20]));
Uncaught TypeError: curr.filter is not a function
Should be:
const intersection = (...arrays) => {
return arrays.reduce((acc, curr) => {
return curr.filter(el => acc.includes(el));
});
};
and similar error downside :)
Some of the solutions to the challenges are missing.
The solutions that are missing are:
Not missing anything:
Lines 181 to 188 in 20de7d4
Above issue is with respect to Extension Question for - http://csbin.io/oop
The code does not prevent userFactory to access sharePublicMessage method.. Instead the solution should be to use Object.create in adminFactory function:
function adminFactory(name, score) {
// Put code here
let newAdminObj = userFactory(name,score);
newAdminObj = Object.create(adminFunctionStore);
newAdminObj.type = "Admin";
return newAdminObj;
}
// Put code here for a method called sharePublicMessage
adminFunctionStore.sharePublicMessage = () => console.log("Welcome users!")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.