In my Angular 2 application, I am working with an array of objects. My goal is to retrieve the next five elements in the array that have a key greater than the one provided.
If I input key = 1, the expected output should be values with keys [2, 3, 4, 5, 6]
If I input key = 2, the expected output should be values with keys [3, 4, 5, 6, 7]
If I input key = 10, the expected output should be values with keys [11, 12, 13, 14]
If I input key = 12, the expected output should be values with keys [13, 14]
[
{key: "1", value: "value1"}
{key: "2", value: "value2"}
{key: "3", value: "value3"}
{key: "4", value: "value4"}
{key: "5", value: "value5"}
{key: "6", value: "value6"}
{key: "7", value: "value7"}
{key: "8", value: "value8"}
{key: "9", value: "value9"}
{key: "10", value: "value10"}
{key: "11", value: "value11"}
{key: "12", value: "value12"}
{key: "13", value: "value13"}
{key: "14", value: "value14"}
]