I am a touch confused about something and i am struggling to pin it down in any documentation.
i am working on the lodash recreation project at Lodash project.
I am working on the has() method
The docs suggest doing something like this
const hasValue = object[key] !== undefined; return hasValue;
which i simplified to
return object[key] ? true : false;
Happy as tests pass with this.
My editor threw me a curveball then and suggested this was unneccesary and that it could be done like this.
test pass with this too. Could someone explain to me how this works though? I am not overly sure what is going on here. Cannot seem to pin down what !! does
Thanks in advance.