js: Use method chaining for multiple array operations.
js: Use method chaining for multiple array operations.

Makes it cleaner and is easier to type annotate.

eeshangarg/zulip,andersk/zulip,eeshangarg/zulip,eeshangarg/zulip,kou/zulip,kou/zulip,rht/zulip,andersk/zulip,andersk/zulip,hackerkid/zulip,rht/zulip,rht/zulip,hackerkid/zulip,zulip/zulip,zulip/zulip,kou/zulip,rht/zulip,andersk/zulip,hackerkid/zulip,hackerkid/zulip,hackerkid/zulip,rht/zulip,hackerkid/zulip,zulip/zulip,eeshangarg/zulip,zulip/zulip,kou/zulip,rht/zulip,eeshangarg/zulip,zulip/zulip,zulip/zulip,andersk/zulip,rht/zulip,kou/zulip,kou/zulip,andersk/zulip,kou/zulip,eeshangarg/zulip,zulip/zulip,eeshangarg/zulip,andersk/zulip,hackerkid/zulip