Skip to content

Instantly share code, notes, and snippets.

@grknylmz
Created September 20, 2017 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grknylmz/ca27babfa66afe37ff4542dbefac8af9 to your computer and use it in GitHub Desktop.
Save grknylmz/ca27babfa66afe37ff4542dbefac8af9 to your computer and use it in GitHub Desktop.
sap.ui.define([
"sap/ui/core/mvc/Controller",
"DemoSAPUI5_Underscorejs/lib/underscore"
], function(Controller) {
return Controller.extend("DemoSAPUI5_Underscorejs.controller.MainView", {
onInit: function() {
var even = _.find([1, 2, 3, 4, 5, 6], function(num) {
return num % 2 == 0;
});
console.warn('LOG');
console.log(even); // Should write '2'
console.warn('LOG');
var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) {
return num % 2 == 0;
});
console.log(evens); // Should write '[2, 4, 6]''
console.warn('LOG');
var bool = _.contains([1, 2, 3], 3); // Does array contain '3'?
console.log(bool);
console.warn('LOG');
debugger;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment