I'm studying jQuery.
When defining a variable, the variable name may or may not be $, but
What are the differences?
Although completely optional, you can name variables with the common jQuery instance with $ as a prefix.
This allows you to see at a glance that the variable has a jQuery instance.
Example:
const name='john'
const$foo=$('#foo')
$foo.text(name)
© 2024 OneMinuteCode. All rights reserved.