Removed unnecessary parentheses around typeof

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-09-04 19:55:07 +03:00
committed by GitHub
parent 90b8f077fa
commit bf87c7c8fc

View File

@ -12,7 +12,7 @@ Finally, use `Object.freeze()` to freeze the given object.
```js
const deepFreeze = obj => {
Object.keys(obj).forEach(prop => {
if (typeof(obj[prop]) === 'object') deepFreeze(obj[prop]);
if (typeof obj[prop] === 'object') deepFreeze(obj[prop]);
});
return Object.freeze(obj);
};