How to generate random numbers with no repeat javascript
问题 I am using the following code which generates random number between 0 to Totalfriends, I would like to get the random numbers but they should not be repeated. Any idea how? This is the code I am using FB.getLoginStatus(function(response) { var profilePicsDiv = document.getElementById('profile_pics'); FB.api({ method: 'friends.get' }, function(result) { // var result =resultF.data; // console.log(result); var user_ids="" ; var totalFriends = result.length; // console.log(totalFriends); var