@pengzhanbo/utils - v3.7.3
    Preparing search index...

    Function notUndefined

    • guard function that returns if val is not undefined

      守卫函数,返回 val 不为 undefined

      Type Parameters

      • T

        The type of elements in the array / 数组元素的类型

      Parameters

      • val: T | undefined

        The value to check. 要检查的值

      Returns val is T

      True if the value is not undefined, false otherwise. 如果值不是undefined则返回true,否则返回false

      [1, '', false, undefined].filter(notUndefined) // => [1, '', false]