Skip to content

Instantly share code, notes, and snippets.

@MoodyBones
Created December 9, 2021 14:27
Show Gist options
  • Select an option

  • Save MoodyBones/bcc89577d2455de72597b62222ad9a4f to your computer and use it in GitHub Desktop.

Select an option

Save MoodyBones/bcc89577d2455de72597b62222ad9a4f to your computer and use it in GitHub Desktop.

Revisions

  1. MoodyBones created this gist Dec 9, 2021.
    12 changes: 12 additions & 0 deletions sortBy.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    sortBy(field) {
    this.applicantsInfo.sort((a, b) => {
    if (a[field] < b[field]) {
    return -1
    }
    if (a[field] > b[field]) {
    return 1
    }
    return 0
    })
    },
    // todo: asc, desc, reset