instance method Array#clear

View source on GitHub →

Array#clear() → Array

Clears the array (makes it empty) and returns the array reference.

Example
var guys = ['Sam', 'Justin', 'Andrew', 'Dan'];
guys.clear();
// -> []
guys
// -> []