{"version":"1.0","type":"rich","title":"Javascript Arrays","description":"This example demonstrates JavaScript array sorting using D3's `descending` comparator on an array of key-value objects. The code defines three entries with keys A, B, and C, then sorts them in descending order by key using the `sort` method with a comparator imported from D3. The result is logged to the console, showing the reordered array. A commented-out section hints at an alternative `reduce` operation that would convert the array into an object mapping keys to values. The example uses D3 version 7.7.0 for its comparator utilities.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/47309ac9f8f841efa41cdc1d8c8af34a?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}