Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.lang.javascript > #6

Any way to do this in JavaScript?

From $Bill <news@todbe.com>
Newsgroups alt.comp.lang.javascript
Subject Any way to do this in JavaScript?
Date 2016-07-18 23:40 -0700
Organization A noiseless patient Spider
Message-ID <nmki0q$nl9$1@dont-email.me> (permalink)

Show all headers | View raw


In Perl, I have:

	my ($title, $chan, $call, $sTime, $dur) = split /~~/, $el;

I've converted this to JavaScript thusly:

	var flds = el.split('~~');	// split into array, then to vars

	var title = flds[0];
	var chan =  flds[1];
	var call =  flds[2];
	var sTime = flds[3];
	var dur =   flds[4];

I was hoping for a more straightforward/cleaner syntax - something like:

	var (title, chan, call, sTime, dur) = el.split('~~'); // do it all in one like Perl

Any way to do that?

Back to alt.comp.lang.javascript | Previous | NextNext in thread | Find similar


Thread

Any way to do this in JavaScript? $Bill <news@todbe.com> - 2016-07-18 23:40 -0700
  Re: Any way to do this in JavaScript? kintalken@gmail.com - 2017-05-18 20:13 -0700

csiph-web