Magento – ReferenceError: jQuery is not defined Magento 2

jquerymagento2magento2.2requirejs-config.js

I created a countdown using JS. For that i need jQuery so I created requireJs file.

var config = {
paths: {
    'countDown': "ABC_CoundDown/js/countDown"
},
shim: {
    'countDown': {
        deps: ['jquery']
    }
}
};

then added jquery in web/js/jquery.js

then in phtml I used

<script type="text/javascript">

require([
    'jquery',
    'countDown',
    'domReady'
    ], function(
    $,
) {
    var date = "2019-02-12";
    var myDate = new Date(date);
    myDate.setDate(myDate.getDate() + 2);
    $("#countdown").countdown(myDate, function (event) {
        $(this).html(
            event.strftime(
                '<div class="timer-wrapper"><div class="time">%D</div><span class="text">days</span></div><div class="timer-wrapper"><div class="time">%H</div><span class="text">hrs</span></div><div class="timer-wrapper"><div class="time">%M</div><span class="text">mins</span></div><div class="timer-wrapper"><div class="time">%S</div><span class="text">sec</span></div>'
            )
        );
    });

});

on frontend I'm getting this error instead of my result
enter image description here

Best Answer

You have a typo in the js code. Remove the , after $ in function($,)