Categories
Web Development

An array of goals

let 2021 = ‘Better than 2020.’;

I’ve written some goals for 2021. Lord willing, I will live and aim to complete them.

I have multiple goals for next year. In JavaScript, multiple things can be grouped together in an array. So my array of goals might look like this:

var goals = ['Pray more', 'Ride bike more', 'Learn more'];

The square brackets [ ] enclose whatever things are inside the array. In my case, I have a bunch of strings. Strings are usually encased within ‘single quotes’, “double quotes” or `back ticks`, like this:

var myGoal1 = 'Pray more';
var myGoal2 = "Ride bike more";
var myGoal3 = `Learn more`;