var $item = $(this).parent().parent().find('input');
This is a code in jQuery
. $
is a valid variable name, and the jQuery library by default defines a variable with the name $
as an alias for jQuery
, in other words, $(this)
is just a shorter way of writing jQuery(this)
On the other hand, in $item
, the dollar sign serves only as an indicator, to make it clear that that variable is storing an object returned by jQuery. If you remove the cipher from this variable, the code would work the same way.
`Starting my ${subject} homework.`
Already in this line of code the cirão has a totally different meaning. Strings bounded with tics can embed variables that are defined within the markup ${}
, in other words
`Starting my ${subject} homework.`
It’s just an alternative way of writing
"Starting my " + subject + " homework."
If you remove the dollar sign from this string, the variable subject
would not be embedded in that string, and instead of generating a string like Starting my arithmetic homework.
for example, you would simply generate Starting my {subject} homework.