Message from JavaScript discussions
November 2017
— Nice
var subject = {
people: [
{
name: "Jon Snow",
number: 5555555555
},
{
name: "John Madden",
number: 1231231234
},
{
name: "Jimmy Neutron",
number: 0001112222
}
],
peopleCount: 3
};
// Will clone all numbers and their paths into a new Object
var copy = differentia.filter(subject, function (currentValue, accessor, subject) {
return typeof currentValue === "number";
});
console.log(copy);
// Logs:
/*
{
"peopleCount": 3,
"people": [
{
"number": 5555555555
},
{
"number": 1231231234
},
{
"number": 0001112222
}
]
}
*/
— Could it be namespaced? .paths.find!
— Ehh, that might be... Messy
— Nevermind
— Namespaced?
— Messy is my middle name
— Kek
— That would be a good way to classify those functions more easily
— And since all of them use the word "path" anyways
— Only issue is then I have to design the module revealer differently
— Yeah, but the sub-object would need a backreference