I think I am missing something (thank you in advance for your
patience)
My Attempt:
script
var ara1 = ['a','b','c','d','e'];
var ara2 = ['c','e'];
function ArraySubtract(ara1,ara2) {
var aRes = new Array() ;
for(var i=0;iara1.length;i++) {
if( ! (ara2.contains(ara1[i]) )) {
Hi Mike,
The top part of the code defines the function, but the variable names
are for its internal use, not yours. Perhaps I should have used
demonstration arguments with different names than those being passed.
In practice, you'd put the function inside a systemConfig tiddler and
then invoke it
Thank You, it seems very clear to me now that I had a function, and I
was not invoking it anywhere. . . (**banging head on desk**)
I appreciate you taking the time to explain this to me. I am planning
on using this in a macro, but I have developed the habit (possibly a
bad habit?) of breaking
Hi Mike,
Just to clarify -- that is what the function I posted does ;-)
Mark
On Apr 25, 5:26 pm, Mike eris...@gmail.com wrote:
I think that may be it (or very close)
i.e.
ara1 = [a,b,c,d,e]
ara2 = [c,e]
aRes = [a, b, d]
--
You received this message because you are subscribed to the
I guess you mean a method to produce an array by removing all items
from array 1 that are not in array 2 ?
Something like this?
function ArraySubtract(ara1,ara2) {
var aRes = new Array() ;
for(var i=0;iara1.length;i++) {
if( ! (ara2.contains(ara1[i]) )) {
aRes.push(ara1[i]) ;
}
I think that may be it (or very close)
i.e.
ara1 = [a,b,c,d,e]
ara2 = [c,e]
aRes = [a, b, d]
I tried to google a answer, but without the proper terminology I did
not get any usable results.
Thank You for the feedback,
Mike
On Apr 25, 5:41 pm, Mark S. throa...@yahoo.com wrote:
I guess you
6 matches
Mail list logo