Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81728

Switching Variable in Child Row with Const

$
0
0

So in one of my child rows, I've got a variable that will output a number. This number, I am trying to compare to data in a const and output the matching one in place of the original variable (in my case, round.number). Its stumping me a bit bc of how its within a child row of datatables. Here is an example showing the child rows:

http://live.datatables.net/zavoloqo/2/edit

And this is the const that I'm trying to use to compare/replace with round.number to const number as shown below:

// Index of 0 to 51 : ♦2 to ♣A ( ie. '4' equates to ♦3 )
    const CARDS = [ 
      ♦2, ♥2, ♠2, ♣2, ♦3, ♥3, ♠3, ♣3, ♦4, ♥4,  
      ♠4, ♣4, ♦5, ♥5, ♠5, ♣5, ♦6, ♥6, ♠6, ♣6, 
      ♦7, ♥7, ♠7, ♣7, ♦8, ♥8, ♠8, ♣8, ♦9, ♥9, 
      ♠9, ♣9, ♦10, ♥10, ♠10, ♣10, ♦J, ♥J, ♠J, 
      ♣J, ♦Q, ♥Q, ♠Q, ♣Q, ♦K, ♥K, ♠K, ♣K, ♦A, 
      ♥A, ♠A, ♣A 
    ]; 

// Game event translation ( output from round.number = CARDS[Math.floor(float * 52)] )
    const number = CARDS[Math.floor(float * 52)];

Viewing all articles
Browse latest Browse all 81728

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>