benchmarks/scenarios/ember.js
function setDiff(setAProperty, setBProperty) {
    if (arguments.length !== 2) {
      throw new _emberMetalError.default('setDiff requires exactly two dependent arrays.');
    }

    return _emberMetalComputed.computed(setAProperty + '.[]', setBProperty + '.[]', function () {
      var setA = this.get(setAProperty);
      var setB = this.get(setBProperty);

      if (!_emberRuntimeUtils.isArray(setA)) {
        return _emberRuntimeSystemNative_array.A();
      }
      if (!_emberRuntimeUtils.isArray(setB)) {
        return _emberRuntimeSystemNative_array.A(setA);
      }

      return setA.filter(function (x) {
        return setB.indexOf(x) === -1;
      });
    }).readOnly();
  }
function setDiff(setAProperty, setBProperty) {
    if (arguments.length !== 2) {
      throw new _emberMetalError.default('setDiff requires exactly two dependent arrays.');
    }

    return _emberMetalComputed.computed(setAProperty + '.[]', setBProperty + '.[]', function () {
      var setA = this.get(setAProperty);
      var setB = this.get(setBProperty);

      if (!_emberRuntimeUtils.isArray(setA)) {
        return _emberRuntimeSystemNative_array.A();
      }
      if (!_emberRuntimeUtils.isArray(setB)) {
        return _emberRuntimeSystemNative_array.A(setA);
      }

      return setA.filter(function (x) {
        return setB.indexOf(x) === -1;
      });
    }).readOnly();
  }
function setDiff ( setAProperty , setBProperty ) { if ( arguments . length !== 2 ) { throw new _emberMetalError . default ( 'setDiff requires exactly two dependent arrays.' ) ; } return _emberMetalComputed . computed ( setAProperty + '.[]' , setBProperty + '.[]' , function ( ) { var setA = this . get ( setAProperty ) ; var setB = this . get ( setBProperty ) ; if ( ! _emberRuntimeUtils . isArray ( setA ) ) { return _emberRuntimeSystemNative_array . A ( ) ; } if ( ! _emberRuntimeUtils . isArray ( setB ) ) { return _emberRuntimeSystemNative_array . A ( setA ) ; } return setA . filter ( function ( x ) { return setB . indexOf ( x ) === - 1 ; } ) ; } ) . readOnly ( ) ; }
A computed property which returns a new array with all the
properties from the first dependent array that are not in the second
dependent array.

Example

```javascript
var Hamster = Ember.Object.extend({
likes: ['banana', 'grape', 'kale'],
wants: Ember.computed.setDiff('likes', 'fruits')
});

var hamster = Hamster.create({
fruits: [
'grape',
'kale',
]
});

hamster.get('wants'); // ['banana']
```

@method setDiff
@for Ember.computed
@param {String} setAProperty
@param {String} setBProperty
@return {Ember.ComputedProperty} computes a new array with all the
items from the first dependent array that are not in the second
dependent array
@public
A computed property which returns a new array with all the properties from the first dependent array that are not in the second dependent array .