Skip to content

Instantly share code, notes, and snippets.

@venkat
Created May 2, 2017 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save venkat/87c281be495027b8399bff852e55af01 to your computer and use it in GitHub Desktop.
Save venkat/87c281be495027b8399bff852e55af01 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=87c281be495027b8399bff852e55af01
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p>
The length of the array is: <span id="len"></span>
</p>
<p>
A random whole number between 0 and length of the array is: <span id="rand"></span>
</P>
</body>
</html>
{"enabledLibraries":["jquery"]}
var stuff =[47, "hello", false, null, 12, 97, 800, "ScriptEd", "pencil", 2, 6876, 2016, 15, "Justin Beiber", "water bottle", "phone", 4.13, 76, 90, 81, "world", "sting", 65, 37, 82, "bye", "New York", "laptop", "A", "Z", 34, 809, 789, 43, 56, "T", "O", 25, "JavaScript", "notebook", 765764, 19873];
//Challenge 1: Use the jquery $(selector).append() to append the length of the array
//to the id #len
//Challenge 2: Generate a random whole number between 0 and the amount of items in this array. Use the jquery $(selector).append() to append that number to the id #rand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment