返回语句返回“未定义”

时间:2021-05-07 11:26:08

标签: javascript return

嗨,我有下一个问题^^

 _checkRadios(item) {
        $(item).each(function () {
            if ($(this).prop("checked") && $(this).hasClass("input9")) {
                let error_box = $(this).nextAll(".ce-form__error");
                error_box.css("display", "block");
                console.log(error_box);
                return false;
            } else {
                let error_box = $(this).nextAll(".ce-form__error");
                error_box.css("display", "none");
                return true;
            }
        })
    }  
let radiosValid = _checkRadios(radioType);
console.log(_checkRadios) //returns undefined

有人知道为什么函数 "_checkRadios" 返回 undefined 吗?

0 个答案:

没有答案