2 ms·
I'm a little confused. It seems like he didn't need to call the sort function in order to call the alert function. Is this correct? He could have built the aler
by wmwong 16y ago
I'm a little confused. It seems like he didn't need to call the sort function in order to call the alert function. Is this correct? He could have built the alert call in the same manner and just call it by itself. I assume the sort function was thrown in there for a larger example?
- bradshaw1965 16y agoThe reddit link in the post right above yours explains that sort is used to get a reference to the "window" object since sort returns "this" and by assigning it to a variable it returns the default context which in this case is "window".