79831956

Date: 2025-11-27 17:17:10
Score: 2
Natty:
Report link

Thanks to Pointy I have found a good solution.

function isSigned(TypedArray) {
    const sample = TypedArray.BYTES_PER_ELEMENT === 8 ? [-1n] : [-1];
    const array = new TypedArray(sample);
    return ArrayBuffer.isView(array) && array[0] < 0;
}
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Shohjahon Jalilov