I have this big question if i can do this with simple tools.
If i have a function with 2 objects for parameters and i want to return only the properties of both that are unique, how i could write that?
function uniqueKeys(obj1, obj2) {
}
With a premise like this:
let obj1 = { name: "Jon", lastName: "Snow"};
let obj2 ={name:"Walter", alias:"Heisenberg"}
uniqueKeys(obj1, obj2) returns => ["lastName", "alias"];
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
If you want the keys you can use Object.keys. I might also suggest looking at filter and includes (look at the Array methods). Your reduce also isn’t correct and you are running it on something that doesn’t exist, result does not exist in the scope you are using it in.