UNPKG

@yookue/ts-lang-utils

Version:

Common lang utilities for typescript

3 lines 166 B
export function get(array, index, defaultValue) { return !array || !array.length || index === undefined || index > array.length - 1 ? defaultValue : array[index]; }