Javascript best practices

Destructuring

  • Object

    Include example

  • Array

    const vegies = [“lettuce”, “broccoli”, “artichoke”, “celery”, “carrots”]
    const [light_green, dark_green, more_vegies] = vegies
    console.log(light_green); // “lettuce”
    console.log(dark_green); // “broccoli”
    console.log(more_vegies); // “artichoke”, “celery”, “carrots”