I'm working on a project for school, I saw some example solutions online and I can make sense of most of the code but I'm not entirely sure what this line does.
var $newTweet = $('<div class=tweet></div>');
I'm assuming that it creates a jQuery variable with the value set to a blank <div>
with the class of tweet, but I want to be certain and also understand the syntax.
Why does a dollar sign precede the variable value? I know dollar signs are used in jQuery and understand why one precedes newTweet
(the variable name) but I don't understand why it precedes the variable value.
Also why is the inside of the $()
in quotes?