Variable declaration reset: Difference between revisions
Content added Content deleted
m (→{{header|jq}}) |
|||
Line 301: | Line 301: | ||
As it happens, if the first argument of range/2 was changed to 0, the correct results would still be correct because at the first iteration, the test would be $array[0] == $array[-1], the point being that $array[-1] evaluates to the last element of the array. |
As it happens, if the first argument of range/2 was changed to 0, the correct results would still be correct because at the first iteration, the test would be $array[0] == $array[-1], the point being that $array[-1] evaluates to the last element of the array. |
||
⚫ | |||
``` |
|||
⚫ | |||
| . as $array |
| . as $array |
||
| range(1;length) |
| range(1;length) |
||
| select( $array[.] == $array[.-1]) |
| select( $array[.] == $array[.-1]) |
||
</lang> |
|||
``` |
|||
=={{header|Julia}}== |
=={{header|Julia}}== |