JavaScript Tutorial - Get Or Remove Random Array Elements

Опубликовано: 10 Октябрь 2013
на канале: Adam Khoury
20k
218

Code:
Since JavaScript does not have built in methods for selecting or removing array elements randomly, we will demonstrate how to extend the Array object to supply it with those types of methods. The first example shows how to get a random array element without affecting the original array, the second example shows how to randomly splice an element from an array which removes the target item from the array. We also show how to extend the JavaScript Array object with these custom methods.


Смотрите видео JavaScript Tutorial - Get Or Remove Random Array Elements онлайн без регистрации, длительностью 09 минут 27 секунд в хорошем hd качестве. Это видео добавил пользователь Adam Khoury 10 Октябрь 2013, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 20 тысяч раз и оно понравилось 218 людям.