Simple list maker in Javascript