keysFirst

Type:Function
Status:stable
Platform:jsnode
@blackbyte.sugar.shared.array

Make sure the passed array start with the passed keys

Params

  1. array*-Array

    The array to sort

  2. keys*-Array

    The keys to start the array with

Return

  1. -Array

    The processed array

Example

import { keysFirst } from '@blackbyte/sugar/array'
keysFirst(['a','b','d','g','c'], ['d','g'])
// ['d','g','a','b','c']