News for hackers. Stuff that matters.
Re:Flatten Arrays in Vanilla JavaScript with Flat() and Flat... by khalilch2 on Wednesday January 05, 2022 @12:47PM (#29812287)
wouldn't the output be ['basic', 'system-admin', 'developer'] rather than array[0] being 'admin'?
Re:Flatten Arrays in Vanilla JavaScript with Flat() and Flat... by tzs on Wednesday January 05, 2022 @01:37PM (#29813069)
You are right that it should be 'basic', not 'admin'. But the order should be 'system-admin', 'developer', and finally 'basic'.
Re:Flatten Arrays in Vanilla JavaScript with Flat() and Flat... by saranshk on Wednesday January 05, 2022 @01:39PM (#29813093)
you are right, I was trying to format it for HN but somehow screwed up copy pasting, though it'd be ["system-admin", "developer", "basic"] and not ['basic', 'system-admin', 'developer']