get each primary colour and add into an array javascript

JavaScript
get primary colors from response and add into an array 
Source

Also in JavaScript: