Tuesday 29 March 2016

Probably really simple question, storing data

Ok, I can't seem to find any help for this.I have one JS file that asks a user on the command line to enter a number.I have another JS file with an array. I need the number the user entered to be stored in that array (in the next entry).For example: The first JS file is run. It asks the user to input a number. The user inputs '5'.In the second JS file, there is an array, lets call it A. Before the user entered the number, A=[4,6,1]. Now A=[4,6,1,5].If we run the first program again, and the user inputs 2, now A = [4,6,1,5,2].Also: If I want to write another program that calls a value of A, how would I do that?

Submitted March 30, 2016 at 02:08AM by asdfCode

No comments:

Post a Comment