Skip to content

Instantly share code, notes, and snippets.

View kabir-rab's full-sized avatar

Kabir Rab kabir-rab

View GitHub Profile
@Thaekeh
Thaekeh / sortingNumerically.js
Last active January 31, 2023 22:39
Sorting an array numerically
computed: {
sortedArray() {
let sortedRecipes = this.recipes;
if (sortMethod == 'alphabetically' {
sortedRecipes = sortedRecipes.sort((a,b) => {
let fa = a.title.toLowerCase(), fb = b.title.toLowerCase();
if (fa < fb) {
return -1
}