Closed flowmemo closed 5 years ago
It may seem no difference when run this application, but if you log document.readyState
in top of these function expression, you would see it is ''loading". After delete those redundant parentheses, document.readyState
is ''interactive“.
You can checkout "log-origin" and "log-patch" branches in my fork.
Someone has mentioned the same issue before in this PR #10
https://github.com/udacity/frontend-nanodegree-feedreader/blob/master/js/app.js#L134 https://github.com/udacity/frontend-nanodegree-feedreader/blob/master/jasmine/spec/feedreader.js#L72
In each of above two lines, there is a pair of parentheses make function expression become an IIFE(Immediately-invoked function expression), which return
undefined
.If we want to utilize jQuery's
.ready
function (https://api.jquery.com/ready/), we should pass a function object to it, notundefined
.I made this PR #17 .