This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function isObject (variable) { | |
return false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import isObject from './isObject' | |
describe('isObject', () => { | |
test('String', () => { | |
expect(isObject('myString')).toEqual(false) | |
}) | |
test('Object', () => { | |
expect(isObject({ param: 'value' })).toEqual(true) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function isObject (variable) { | |
return typeof variable === 'object' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function isObject (variable) { | |
return variable instanceof Object | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function isObject (variable) { | |
return variable.constructor === Object | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function isObject (variable) { | |
return variable !== undefined && variable !== null && variable.constructor === Object | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function isObject (variable) { | |
return Object.prototype.toString.call(variable) === '[object Object]' | |
} |
Livres préférés
- Le cycle de la fondations (tous), d'Azimov
- La vérité sur l'affaire Harry Quebert, Joël Dicker
- Stupeur et Tremblements, Amélie Nothomb
- Le Joueur d'échecs, Stefan Zweig
- L'Homme est un accident, Adrien Rivierre x Enki Bilal
- Les piliers de la terre, Ken Follett