How to "connect" a list of points in the order of their index

Does it specifically need to be a function that does this? Desmos will natively join points together from a list, if that’s all you need: