Re:Modern PHP
by dylan604 on Sunday March 27, 2022 @11:29AM
(#30820989)
jquery, lodash, etc all added prefixes (or TIL: sigil) of somesort
[ Parent
| on HN ]
jQuery's $ and lodash's _ are not prepended to a symbol to denote a variable. Both are objects actually. In the case of jQuery, $ === jQuery (the root jQuery object). The case that the parent is talking about is PHP's requirement that all variables are denoted as such `$variable_name`. (Perl and Bash also do this)
i forget that's what's actually being done under the hood.
That’s just (part of) the variable name and not really the same.
Re:Modern PHP
by throw_m239339 on Sunday March 27, 2022 @12:52PM
(#30821749)
> jquery, lodash, etc all added prefixes (or TIL: sigil) of somesort
This is false they are not sigils at all. _ and $ are legal variable names in Javascript.