From 1e1325eb06f627fa056b31010550d65f32623b05 Mon Sep 17 00:00:00 2001 From: Kara <62033369+kar320@users.noreply.github.com> Date: Wed, 27 Apr 2022 10:18:50 -0600 Subject: [PATCH] Update remove duplicates from using vars to lets Updating this sample to be republished as a library quickstart. --- sheets/removingDuplicates/removingDuplicates.gs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sheets/removingDuplicates/removingDuplicates.gs b/sheets/removingDuplicates/removingDuplicates.gs index b403c8f64..4047564ee 100644 --- a/sheets/removingDuplicates/removingDuplicates.gs +++ b/sheets/removingDuplicates/removingDuplicates.gs @@ -20,16 +20,16 @@ */ function removeDuplicates() { // [START apps_script_sheets_sheet] - var sheet = SpreadsheetApp.getActiveSheet(); - var data = sheet.getDataRange().getValues(); + let sheet = SpreadsheetApp.getActiveSheet(); + let data = sheet.getDataRange().getValues(); // [END apps_script_sheets_sheet] // [START apps_script_sheets_new_data] - var newData = []; + let newData = []; // [END apps_script_sheets_new_data] - for (var i in data) { - var row = data[i]; - var duplicate = false; - for (var j in newData) { + for (let i in data) { + let row = data[i]; + let duplicate = false; + for (let j in newData) { if (row.join() == newData[j].join()) { duplicate = true; }