The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Get A Random Element From A JavaScript Array

TODO: Pull subtitle into page object script_start_default_section script_end_default_section

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Get A Random Element From A JavaScript Array

This is how I'm getting a random item from
a JavaScript array

-- script/
-- show

const widget = [
  "alfa", "bravo", "charlie"
]

const randomItem =
  widget[Math.floor(Math.random() * widget.length)]


console.log(randomItem)


-- /script

-- ref
-- url: http://stackoverflow.com/questions/5915096/get-random-item-from-javascript-array


-- categories
-- JavaScript 

-- metadata
-- date: 2014-08-13 10:53:03
-- id: 018z7xq8
-- status: published
-- type: post
-- site: aws