Skip to content

Instantly share code, notes, and snippets.

View MihailoJoksimovic's full-sized avatar

Mihailo Joksimovic MihailoJoksimovic

View GitHub Profile
var userChoice = ["paper", "rock", "scissors"];
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = userChoice[1];
} else if(computerChoice <= 0.67) {
computerChoice = userChoice[0];
} else {
computerChoice = userChoice[2];
} console.log("Computer: " + computerChoice);
onSimulateOrdersClick: function(article) {
console.log("Simulating for article:");
console.log(article);
var me = this;
var articleId = article.get('article_id');
// First we have to load All data about article before proceeding any further.