back soft

مطالب مرتبط با «swap values c» در back soft | نویسنده: استخدام کار

swap the values of 4 variables with jquery or javascript

Vote count: 0 Originally I was using the following to swap the values of 2 variables at random when the page loaded: var value1 = 260; var value2 = 325; var chosenValue = Math.random() < 0.5 ? value1 : value2; if (value1 == chosenValue) { var val = value1; } else { var val = value2; } if (value1 == chosenValue) { var val2 = value2; } else { var val2 = value1; } However now I need to swap out 4 values and I no idea how to go about doing that. var value1 = 260; var value2 = 325; var value3 = 195; var value4 = 130; Note that each value must be used only once and must be displayed in random order each time page is loaded. help? asked 1 min agoBruce Let's block ads! بخوانید...

ادامه مطلب

برچسب‌های مرتبط

swap the values of two variables in java | swap the values of two columns in sql server | swap the values of two variables | swap the values of two variables using pointers | swap the values of two variables without third variable | swap the values of two variables python | swap the values of two numbers in java | swap the values | swap values c++ | swap values in java