Javaスクリプトのコードを書いています。ここに要らないカッコあるいは必要なカッコはありますか?
const header = document.creatElement("header"); function header(){ $("header").each(function)(){ var elemPos = $(this).offset().top-50; var scroll = $(window).scrollTop(); var windowHeight = $(window).height(); if (scroll >= elemPos - windowHeight){ $(this).addClass("header"); $(this).children("header"); } } }