---
title: "Comment by Victor Olorunfemi on \"Urgent 2k for JavaScript Developers\" | Hashnode"
description: "Summary I enjoyed solving this problem. My process goes as follow: I created a function `getData() - function in javascript are code that performs a particular"
url: "https://hashnode.com/posts/urgent-2k-for-javascript-developers/61685e0353401f641ba16faa/comment/616bef4d7c361e513282269d"
---

[Discussion](https://hashnode.com/posts/urgent-2k-for-javascript-developers/61685e0353401f641ba16faa)

Comment [Urgent 2k for JavaScript Developers](https://hashnode.com/posts/urgent-2k-for-javascript-developers/61685e0353401f641ba16faa)

[Victor Olorunfemi](https://hashnode.com/@Clefayomide)

[Oct 17, 2021](https://hashnode.com/posts/urgent-2k-for-javascript-developers/61685e0353401f641ba16faa/comment/616bef4d7c361e513282269d)

### Summary

I enjoyed solving this problem. My process goes as follow:

1.  I created a function `` `getData() `` - function in javascript are code that performs a particular task when called.
2.  i declared a variable `didnt_submit` and assigned it to an empty array - variable in javascript are like a container that holds different type of information, while array in javascript are ordered list or collection of data
3.  The `getData()` function then fetches the data of all students and students who submitted from the google sheet which i have converted to `.txt` format
4.  The data gotten are now been stored in an array using the `split()` method - the `split()` method in javascript takes a string/strings and return a new array of that string/strings
5.  Now that we have converted our data - all\_students and student who submitted - into an array, lets fish out students who did not submit. i achieved this using the `forEach()` method in javascript - `forEach()` method loops through an array and executes a call back function once for each element in the array. Call back function are function that are passed into another function and are only executed after another function has finished executing. In this case, everytime the loop goes through the array of all the students, it checks if the email string returned from each loop is included in the array of students who submitted, if its not, it then pushes the string into the empty array `didnt_submit` that was declared earlier on

![Screenshot 2021-10-17 at 14-35-14 script js.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1634477792707/YqsU_9dk3.png)

[gist.github.com/clefayomide/d78c9c908a49baac31b8a…](https://gist.github.com/clefayomide/d78c9c908a49baac31b8a2756948232e)
