The question of lodash.js createSet function

topic description

when looking at the lodash source code, there is such a judgment when you see the createSet function Set & & (1 / setToArray (new Set ([,-0]) [1]) = = INFINITY I don"t quite understand the second half of (1 / setToArray (new Set ([,-0])) [1]) = INFINITY meaning

related codes

const createSet = (Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) 
  ? (values) => new Set(values)
  : () => {}
Aug.09,2021

for Set , there is a difference between -0 and + 0 , but the specification specifies that-0 and + 0 are equal after es2015. There is a browser compatibility problem. If the standard is followed, new Set ([,-0]) [1] returns 0 , otherwise it returns -0 , and the result of 1 /-0 is -Infinity does not mean that Infinity, uses empty objects as an alternative implementation of the standard Set at this time,

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e589a7-454d9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e589a7-454d9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?