Author:
erics, December 5th, 2020
|
S.example.doTask({task:'getdata',step:2}); var S = {}; S.example.doTask = function({task = '',step = 0} = {}) { alert('Task: '+task+', 'Step: '+step); } |
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
Categories: How-To's, Technology Tags: Arg, Argument, howto, JavaSvript, JS, Named parameter, param, Parameter, tips
|
No comments
Author:
erics, December 11th, 2019
When using Perl’s exec() call, the best way to invoke it is as follows:
|
exec("$dir/myprog.sh",@ARGV); |
This syntax does some important things: – passes a scalar value as the first argument which exec interprets as PROGRAM – passes an array as the second argument which exec will use as the arguments to pass into PROGRAM Note […]
Categories: How-To's, Technology Tags: Arg, Args, Argument, Arguments, bash, Exec, Execute, perl, Program, sh, Shell, System
|
No comments
Author:
erics, August 19th, 2011
A small step forwards in understanding how Perl handles hashes as arguments. This biggest difference is that the first way “slurps” in ALL passed values in @_ into the %args hash. The second (cooler) way, pulls in the arguments hash as a single scalar variable, allowing multiple variables to be passed via @_, if you […]
Categories: How-To's, Technology Tags: Argument, Hash, howto, perl, Subroutine, tips
|
No comments