This is the first time seeing this. I have looked this up and have not found anything pertaining to this syntax of $(()).
<script>
'use strict';
$(() => {
// code goes here
});
</script>
This is the first time seeing this. I have looked this up and have not found anything pertaining to this syntax of $(()).
<script>
'use strict';
$(() => {
// code goes here
});
</script>
This is, for the most part, the equivalent of:
<script>
'use strict';
$(function() {
// code goes here
});
</script>
Which, assuming the $
variable is assigned to the jQuery library, will be a "normal" document ready callback function.
You can learn more about arrow functions here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions