Assignments JS.Arrays

Handing In Assignments

You must hand in by using git

Hand In by git

  • Create an empty repo on bitbucket.org, gitlab.com, or github.com,
  • git push your local repo to the above remote repo.
  • For node assignments please put the line(s)

    node_modules/

    into your .gitignore file.

Send a mail to with:

  • The word 'handin <subjectname>' in the subject line of your mail
  • The url of your repo(s).

Assignment JS.Arrays.1

In the assignments Conds.0, and Funcs.2, you were flipping a coin of rolling a die. In both cases you used counter variables to tally the number of the various outcomes. Now you must change that to using an array instead of individual variables. Write a comment or two about it in the code.

Hand in as a file called jsArrays1.js

Assignment JS.Arrays.2

Write a function that checks whether an array is palindromic, ie whether the first and last elements are identical, and the middle is palindromic.

Hand in as a file called jsArrays2.js

Assignment JS.Arrays.3

Write a program that rolls a die i times, and then two functions that check

  • whether all faces were the same.
  • whether there were any n's where n is between 1-6

Hand in as a file called jsArrays3.js