Skip to content

Instantly share code, notes, and snippets.

View prodigitalson's full-sized avatar

Ant Cunningham prodigitalson

View GitHub Profile
@prodigitalson
prodigitalson / object-keys.test.js
Last active April 17, 2020 15:12
Please don't use booleans as object keys
describe('Object with boolean keys', () => {
it('Preserves type boolean when used as a key', () => {
const obj = {
true: 'true',
false: 'false'
};
const actual = Object.keys(obj);
expect(actual[0]).toBe(true);