JSPM

draw-from-array

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q12172F
  • License MIT

Draw one random element from an array

Package Exports

  • draw-from-array

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (draw-from-array) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Draw from Array

Takes out one random element from array.

let drawFromArray = require("draw-from-array");

let cards = [
  "Ace",
  "2",
  "3",
  "4",
  "5",
  "6",
  "7",
  "8",
  "9",
  "10",
  "Jack",
  "Queen",
  "King",
];

let drawn = drawFromArray(cards);
//drawn: ["Ace"]

//drawFromArray: ["2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"]