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;i<ara1.length;i++) {
    if( ! (ara2.contains(ara1[i]) )) {
      aRes.push(ara1[i]) ;
    }
  }
  return aRes ;

}

wikify(ara1+' (ara1)'+'\n' ,place);
wikify(ara2+' (ara2)' +'\n' ,place);
wikify(aRes+' (aRes)' +'\n' ,place);
</script>

Results: (wikify x3 to separate results / error)
a,b,c,d,e (ara1)
c,e (ara2)
ReferenceError: aRes is not defined

Did I miss something? / Wrong usage?

Mike

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to