Add scroll method but it’s showing error on console onScroll is not defined

Add scroll event and it’s showing in console onScroll is not define

Here is my code

$('.profile - navigation ul li a').on('click', function () {

    var scrollAnchor = $(this).attr('data-scroll'),
        scrollPoint = $('section[data-anchor="' + scrollAnchor + '"]').offset().top - 28;

    $('body,html').animate({
        scrollTop: scrollPoint
    }, 500);

    return false;

})

$(window).scroll(function () {

    if ($(this).scrollTop() < $('section[data-anchor="top"]').offset().top) {
        $('.profile - navigation ul li a').removeClass('active');
    }

    if ($(this).scrollTop() >= $('section[data-anchor="top"]').offset().top) {
        $('.profile - navigation ul li a').removeClass('active');
        $('.profile - navigation ul li a:eq(0)').addClass('active');
    }
    if ($(this).scrollTop() >= $('section[data-anchor="news"]').offset().top) {
        $('.profile - navigation ul li a').removeClass('active');
        $('.profile - navigation ul li a:eq(1)').addClass('active');
    }
    if ($(this).scrollTop() >= $('section[data-anchor="products"]').offset().top) {
        $('.profile - navigation ul li a').removeClass('active');
        $('.profile - navigation ul li a:eq(2)').addClass('active');
    }
    if ($(this).scrollTop() >= $('section[data-anchor="contact"]').offset().top) {
        $('.profile - navigation ul li a').removeClass('active');
        $('.profile - navigation ul li a:eq(3)').addClass('active');
    }

});

$(window).scroll(function () {

    if ($(window).scrollTop() >= 100) {

        $('.profile-navigation').addClass('fixed');

    } else {

        $('.profile-navigation').removeClass('fixed');

    }

});