JSFiddle - React, Tailwind, and code Playground

by topeson

JavaScript

var limb_1 = "yamas are the social disciplines";
//console.log(limb_1);
//alert(limb_1);
var limb_2 = "niyamas are the personal disciplines";
var limb_3 = "niyamas are the personal disciplines";
var limb_4 = "asana is physical body control";
var limb_5 = "pranayama is life force control";
var limb_6 = "dharana is concentration";
var limb_7 = "dhyana is meditation";
var limb_8 = "samadhi is the goal of yoga";
var all_limbs = [limb_1, limb_2, limb_3, limb_4, limb_5, limb_6, limb_7, limb_8];
//console.log(all_limbs);
//alert(all_limbs);
var show_my_culture = function(){
    var pick = Math.floor(Math.random() * all_limbs.length); //this line assigns a random number the pick variable that is between 0 and the length of the array
    alert(all_limbs[pick]);
    //you can alternatively call console.log(my_array) if you wish
}
  //to call the function
show_my_culture();