Nice Read!
You might want to edit your first program implementation as you console result variable but there's no where you declared and assigned value to it.
I guess you skipped to assign the function call to result variable like const result = useSet(arr)