3 ms·
Note that this breaks with Babel and TypeScript, since I guess this is one aspect where neither strictly follows the spec. Both of these examples print false:
by alangpierce 8y ago
Note that this breaks with Babel and TypeScript, since I guess this is one aspect where neither strictly follows the spec. Both of these examples print false:
https://babeljs.io/repl/build/master/#?babili=false&browsers=&build=&builtIns=false&code_lz=GYVwdgxgLglg9mABDAzgYQDYEMUoBTBgCUiA3gFCKIBOAplCNUgIQDyARgFa3QB0A5vVYB3MAAVqcAA61qUAJ4ARWigjUYUqHGoEwAGkQByKZK0KZhor2HqoWdhloBucgF9y5CNlyIAgmXdPBBQ4R14MOH48VEwcfF8iIhcgA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=true&fileSize=false&lineWrap=true&presets=es2015%2Creact&prettier=false&targets=&version=7.1.6&envVersion= https://babeljs.io/repl/build/master/#?babili=false&browsers...
https://www.typescriptlang.org/play/index.html#src=function%20isClass(fn)%20%7B%0A%20%20return%20!Object.getOwnPropertyDescriptor(fn%2C%20'prototype').writable%3B%0A%7D%0A%0Aclass%20A%20%7B%7D%0A%0Aconsole.log(isClass(A))%3B%0A https://www.typescriptlang.org/play/index.html#src=function%...