Shuffle deck of cards in JavaScript
There has already been some discussion by @Oh My Goodness and @Blindman67 in the comments about the time complexity of this code vs Fisher-Yates. I don't really have much to add to that discussion but will offer some suggestions about the code on a deeper level below.

Like I mentioned in my answer to your post Simple math game in JavaScript some variable names could more accurately hint at the semantic meaning of the value - for example, instead of x.ran = Math.random();, a name like sortVal would hint that the value is to be used for sorting.

array.forEach( x =&gt;{
  x.sortVal = Math.random();
})




The arrow function in the shuffle() method is quite short and thus can be simplified to a single line:

array.sort( (a, b) =&gt; a.sortVal - b.sortVal)


The forEach block above it could also be simplified:

array.forEach( x =&gt; x.sortVal = Math.random())


In this case, x.sortVal would be returned in each iteration but that doesn't make a difference.



The Array sort method Array.prototype.sort() returns the array so the shuffle() function could be simplified to have the return statement on the same line as the call to that method:

  return array.sort( (a, b) =&gt; a.sortVal - b.sortVal)




Additionally, any value that doesn't get re-assigned could be declared using const, which would help avoid any unintentional re-assignment - e.g. deck within shuffle(), and deck at the end of the code.