Where did jquery go?
by Rick Hedin
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<document html>
<body>
<div id="mydiv">
Nothing to see here. Move along.<br>
Hm. They both work.<br>
In my actual code, the function defined using big arrow
can't find jquery.
</div>
</body>
</document>
JavaScript
var regfcn = function () {
var mydiv = $('#mydiv');
console.log('In regfcn.', mydiv);
}
var arofcn = () => {
var mydiv = $('#mydiv');
console.log('In arofcn.', mydiv);
}
regfcn();
arofcn();