Get the Difference Between Two Arrays in JavaScript

Sometimes we want to compare the difference between two arrays in JavaScript and return the remaining values in a new array.

This can be useful for inventory or purchase management where we could compare the selected items against the available stock, for example.

In this tutorial, we will cover two approaches to this:

  1. A single set of unique items in an array.
  2. A main array containing duplicate items.

Let’s get cracking!

Continue reading “Get the Difference Between Two Arrays in JavaScript”

Google Apps Script Course – Part 4: 2D Array Data Transformation of Multiple Question Multiple Group Items Data to Total Count of Rating Choices in Google Sheets

Google Apps Script, Google Sheets, SpreadsheetApp, 2d arrays

<<Part 3                                         <<Intro>>

In Part 3 of our 2D array data transformation course in Google Apps Script, we worked out how to get the count of each choice of each question item from the survey results in a Google Sheet.

This time we are going to add a final element to our mix. Let’s say we have multiple questions and multiple groups. We want to find out the count for each choice for each question for each group.

Continue reading “Google Apps Script Course – Part 4: 2D Array Data Transformation of Multiple Question Multiple Group Items Data to Total Count of Rating Choices in Google Sheets”