How Can I Make a Loop of two arrays with some rules - javascript

I need some help
I have two arrays:
First array have Boolean elements. (It's true when button is active , and false if not)
The second one strings where "0"(active) or "1" (inactive).
let arrayBotoesCategorias = [iconCategoriaIndividual, iconCategoriaGrupo, iconCategoriaIndoor, iconCategoriaOutdoor, iconCategoriaAquatico,iconCategoriaNatureza];
let arrayCategorias = [item.individual, item.grupo, item.indoor, item.outdoor, item.aquatico, item.natureza];
To understand better , PaintBall have grupo(group), indoor, outdoor and natureza(nature) activated. The rest are inactive. Like this
individual: "0",
grupo: "1",
indoor: "1",
outdoor: "1",
aquatico: "0",
natureza: "1",
What I need it's the following but of course with another solution:
if(arrayBotoesCategorias[1] == true && arrayBotoesCategorias[2] == true && arrayBotoesCategorias[3] == true && arrayBotoesCategorias[5] == true){
if(arrayCategorias[1] == "1" && arrayCategorias[2] == "1" && arrayCategorias[3] == "1" && arrayCategorias[5] == "1"){
return(itemSection)
}
}
When a element from the first array is true and the same position of the second is == "1" , return something.
Example
In this example image , I Want to show the images that have those 3 tables (outdoor, aquatico and natureza with value "1");

Maybe u need to organize your array like an array of object so that u have options when it comes to validating and the value that changing.
let arrayBotoesCategorias = [
{
label: "iconCategoriaIndividual",
name: "individual",
value: false
},
{
label: "iconCategoriaGrupo",
name: "grupo",
value: false
},
{
label: "iconCategoriaIndoor",
name: "indoor",
value: false
}
];
let arrayCategorias = [
{
label: "individual",
name: "individual",
value: false
},
{
label: "groupo",
name: "groupo",
value: false
},
{
label: "indoor",
name: "indoor",
value: false
}
];
let selectedInput = "individual";
arrayBotoesCategorias.filter((item) => {
item.value = selectedInput === item.name;
return item;
});
arrayCategorias.filter((item) => {
item.value = selectedInput === item.name;
return item;
});
document.body.innerHTML = `
arrayBotoesCategorias ${JSON.stringify(arrayBotoesCategorias)}
<br>
<br>
arrayCategorias ${JSON.stringify(arrayCategorias)}`;
<!DOCTYPE html>
<html>
<head>
<title>Parcel Sandbox</title>
<meta charset="UTF-8" />
</head>
<body>
<div id="app"></div>
<script src="src/index.js">
</script>
</body>
</html>

Already solved Thanks for the help!
var controlCategorias = 0;
var errorControlCategorias = 0;
for(var i = 0; i<arrayBotoesCategorias.length; i++){
switch (i){
case 0:
if((arrayBotoesCategorias[0] && item.individual == "1") || (!arrayBotoesCategorias[0] && item.individual == "0") || (!arrayBotoesCategorias[0] && item.individual == "1")) {
controlCategorias++;
}else{
errorControlCategorias++;
}
break;
case 1:
if((arrayBotoesCategorias[1] && item.grupo == "1") || (!arrayBotoesCategorias[1] && item.grupo == "0") || (!arrayBotoesCategorias[1] && item.grupo == "1")) {
controlCategorias++;
}else{
errorControlCategorias++;
}
break;
case 2:
if((arrayBotoesCategorias[2] && item.indoor == "1") || (!arrayBotoesCategorias[2] && item.indoor == "0") || (!arrayBotoesCategorias[2] && item.indoor == "1")) {
controlCategorias++;
}else{
errorControlCategorias++;
}
break;
case 3:
if((arrayBotoesCategorias[3] && item.outdoor == "1") || (!arrayBotoesCategorias[3] && item.outdoor == "0") || (!arrayBotoesCategorias[3] && item.outdoor == "1")) {
controlCategorias++;
}else{
errorControlCategorias++;
}
break;
case 4:
if((arrayBotoesCategorias[4] && item.aquatico == "1") || (!arrayBotoesCategorias[4] && item.aquatico == "0") || (!arrayBotoesCategorias[4] && item.aquatico == "1")) {
controlCategorias++;
}else{
errorControlCategorias++;
}
break;
case 5:
if((arrayBotoesCategorias[5] && item.natureza == "1") || (!arrayBotoesCategorias[5] && item.natureza == "0") || (!arrayBotoesCategorias[5] && item.natureza == "1")) {
controlCategorias++;
}else{
errorControlCategorias++;
}
break;
}
}
if(controlCategorias > 0 && errorControlCategorias == 0){
return itemSection;
}

Related

Javascript filter between two string dates in Vue component

I'm working with Vue in a Laravel app. Everything below works except the last one. I can't seem to find the right search terms to fit this situation. Sorry if it's a duplicate.
Here is my current code:
return [...this.tableData].filter((salesorders) => {
if (this.selectOption == '6') {
return salesorders.order_status.match(this.status);
}
if (this.selectOption == '1') {
return salesorders.number.includes(this.searchInput);
}
if (this.selectOption == '2' && this.choice == 'is') {
var ship_date = moment(String(this.first_date)).format('MM-DD-YYYY');
return salesorders.requested_ship_date.match(ship_date);
}
if (this.selectOption == '2' && this.choice == 'is not') {
var ship_date = moment(String(this.first_date)).format('MM-DD-YYYY');
return !salesorders.requested_ship_date.match(ship_date);
}
if (this.selectOption == '2' && this.choice == 'is between') {
var ship_date1 = moment(String(this.first_date)).format('MM-DD-YYYY');
var ship_date2 = moment(String(this.end_date)).format('MM-DD-YYYY');
return salesorders.requested_ship_date >= ship_date1 && salesorders.requested_ship_date >= ship_date2;
}
});
I just figured it out:
return salesorders.requested_ship_date >= ship_date1 && salesorders.requested_ship_date <= ship_date2;

Nodejs Express - Is there any way to reduce the following code to something simpler?

I have the following code that I would like to reduce. This question might be very lame, so sorry about it.
I wanted to replace the meal1..10 with a variable in a for loop, but I'm not sure if that can be done in node js.
function hasPortion(meals) {
const portions = ["4", "3", "2", "1", "1/8", "1/4", "1/2"];
if (meals.meal1 != undefined && meals.meal1.activado == "on" && portions.indexOf(meals.meal1.porcion) < 0) { return false; }
if (meals.meal2 != undefined && meals.meal2.activado == "on" && portions.indexOf(meals.meal2.porcion) < 0) { return false; }
if (meals.meal3 != undefined && meals.meal3.activado == "on" && portions.indexOf(meals.meal3.porcion) < 0) { return false; }
if (meals.meal4 != undefined && meals.meal4.activado == "on" && portions.indexOf(meals.meal4.porcion) < 0) { return false; }
if (meals.meal5 != undefined && meals.meal5.activado == "on" && portions.indexOf(meals.meal5.porcion) < 0) { return false; }
if (meals.meal6 != undefined && meals.meal6.activado == "on" && portions.indexOf(meals.meal6.porcion) < 0) { return false; }
if (meals.meal7 != undefined && meals.meal7.activado == "on" && portions.indexOf(meals.meal7.porcion) < 0) { return false; }
if (meals.meal8 != undefined && meals.meal8.activado == "on" && portions.indexOf(meals.meal8.porcion) < 0) { return false; }
if (meals.meal9 != undefined && meals.meal9.activado == "on" && portions.indexOf(meals.meal9.porcion) < 0) { return false; }
if (meals.meal10 != undefined && meals.meal10.activado == "on" && portions.indexOf(meals.meal10.porcion) < 0) { return false; }
return true;
}
If meals only have these 10 properties, you may like this,
function hasPortion(meals) {
const portions = ["4", "3", "2", "1", "1/8", "1/4", "1/2"];
for (const prop in meals) {
const meal = meals[prop];
if (meal != undefined && meal.activado == "on" && portions.indexOf(meal.porcion) < 0) {
return false;
}
}
return true;
}
If you have more properties, but only want to check these 10 properties, you may like this,
function hasPortion(meals) {
const portions = ["4", "3", "2", "1", "1/8", "1/4", "1/2"];
for (let i = 1; i <= 10; i++) {
const prop = `meal${i}`;
const meal = meals[prop];
if (meal != undefined && meal.activado == "on" && portions.indexOf(meal.porcion) < 0) {
return false;
}
}
return true;
}
Append: new solution
As we mentioned, you should use an Array to store all meal items, also you may use a Set to store portions because searching in Set is faster than Array.
const meals = [
{ activado: "on", porcion: "4" },
{ activado: "on", porcion: "1/8" },
{ activado: "on", porcion: "3" },
{ activado: "on", porcion: "1/2" },
];
function hasPortion(meals) {
const portions = new Set(["4", "3", "2", "1", "1/8", "1/4", "1/2"]);
return !meals.some((meal) => meal.activado === "on" && !portions.has(meal.porcion));
}
// Good case
console.log(hasPortion(meals)); // Output: true
// Add bad item
meals.push({ activado: "on", porcion: "1/3" })
console.log(hasPortion(meals)); // Output: false

Combine multiple if statements with multiple properties

I'm looking into using my loop to combine and narrow down this piece of code into maybe a switch statement or other methods, how would I be able to achieve that? This is what I have so far which has worked for me but I also have other items[i].ApplicationType such as 'OneDrive', 'Teams', etc..
for(i = 0; i < items.length; i++)
{
if(items[i].ComputerType == 'Windows' && items[i].RequestType == 'Single User' && items[i].ApplicationType == 'OneDrive')
{
ODwindows += 1;
}
else if(items[i].ComputerType == 'Windows' && items[i].RequestType == 'Single User' && items[i].ApplicationType == 'Teams')
{
Teamswindows += 1;
}
else if(items[i].ComputerType == 'Mac' && items[i].RequestType == 'Single User' && items[i].ApplicationType == 'OneDrive')
{
ODmac += 1;
}
else if(items[i].ComputerType == 'Mac' && items[i].RequestType == 'Single User' && items[i].ApplicationType == 'Teams')
{
Teamsmac += 1;
}
else if(items[i].ComputerType == 'Both' && items[i].RequestType == 'Team' && items[i].ApplicationType == 'OneDrive')
{
ODboth += 1;
}
else if(items[i].ComputerType == 'Both' && items[i].RequestType == 'Team' && items[i].ApplicationType == 'Teams')
{
Teamsboth += 1;
}
}
You could take an object with the different types and count by nested properties.
var count = {
'Single User': {
Windows: {
OneDrive: 0,
Teams: 0
},
Mac: {
OneDrive: 0,
Teams: 0
}
},
Team: {
Both: {
OneDrive: 0,
Teams: 0
}
}
};
for (let { RequestType, ComputerType, ApplicationType } of items) {
count[RequestType][ComputerType][ApplicationType]++;
}
You could create a key for each unique combination of ComputerType, RequestType and ApplicationType separated by _. Then use destructuring to get each count to variables:
const output = {};
items.forEach(o => {
const key = [o.ComputerType, o.RequestType, o.ApplicationType].join('_')
output[key] = output[key] + 1 || 1
})
const {
['Windows_Single User_OneDrive']: ODwindows,
['Windows_Single User_Teams']: Teamswindows,
['Mac_Single User_OneDrive']: ODmac,
['Mac_Single User_Teams']: Teamsmac,
['Both_Team_Teams']: ODboth,
['Both_Team_Teams']: Teamsboth
} = output;
const items = [{ComputerType: "Windows", RequestType:"Single", ApplicationType: "OneDrive"}]
const countObj = items.reduce((accum, item) => {
const { ComputerType, RequestType, ApplicationType } = item
const key = `${ComputerType}_${RequestType}_${ApplicationType}`
return {
...accum,
[key]: accum[key] ? accum[key] + 1 : 1
}
}, {})
console.log(countObj)

Is there a better way to change button display in javascript/Vue?

After writing so many if else, I feel very tired. I'm using Vue. The following code are written in the script section of the vue file. I get a json from file, and then read the values in json, then set what button should be display based on employee level and on application status. Is there a better way to change the button display status in Vue?
if (
(this.GLOBAL2.jsonForGlobal.employeeLevel == "1" &&
(this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Checking" ||
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Pending" ||
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Approved")) ||
(this.GLOBAL2.jsonForGlobal.employeeLevel == "2" &&
(this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Pending" ||
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Approved")) ||
(this.GLOBAL2.jsonForGlobal.employeeLevel == "3" &&
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Approved")
) {
this.pullDisplay = true;
} else {
this.pullDisplay = false;
};
if (
this.GLOBAL2.jsonForGlobal.employeeLevel == "1" &&
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Revising"
) {
this.cancelDisplay = true;
} else {
this.cancelDisplay = false;
};
if (
(this.GLOBAL2.jsonForGlobal.employeeLevel == "1" &&
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Revising") ||
(this.GLOBAL2.jsonForGlobal.employeeLevel == "2" &&
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Checking") ||
(this.GLOBAL2.jsonForGlobal.employeeLevel == "3" &&
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Pending")
) {
this.saveDisplay = true;
} else {
this.saveDisplay = false;
};
if (
this.GLOBAL2.jsonForGlobal.employeeLevel == "1" &&
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Revising"
) {
this.reviseDisplay = true;
} else {
this.reviseDisplay = false;
};
if (
(this.GLOBAL2.jsonForGlobal.employeeLevel == "2" &&
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Checking") ||
(this.GLOBAL2.jsonForGlobal.employeeLevel == "3" &&
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Pending")
) {
this.sendDisplay = true;
} else {
this.sendDisplay = false;
};
if (
(this.GLOBAL2.jsonForGlobal.employeeLevel == "3" &&
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Pending") ||
(this.GLOBAL2.jsonForGlobal.employeeLevel == "2" &&
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus == "Checking")
) {
this.approvalDisplay = true;
} else {
this.approvalDisplay = false;
};
And also there are a few ones need three conditions:
if (
this.GLOBAL2.jsonForGlobal.employeeLevel == "3" &&
this.GLOBAL2.jsonForGlobal.detail[this.detailId].requestCategory ==
"External Request" &&
this.GLOBAL2.jsonForGlobal.detail[this.detailId].currentStatus ==
"Pending"
) {
this.returnDisplay = true;
} else {
this.returnDisplay = false;
}
Going with a configuration based approach will make your code much more easy to edit and to read.
const levels = {
'1': {
pullDisplayStatus: ['Checking', 'Pending', 'Approved'],
cancelDisplayStatus: ['Revising'],
saveDisplayStatus: ['Revising'],
reviseDisplayStatus: ['Revising'],
sendDisplayStatus: [],
approvalDisplayStatus: [],
},
'2': {
pullDisplayStatus: ['Pending', 'Approved'],
cancelDisplayStatus: [],
saveDisplayStatus: ['Checking'],
reviseDisplayStatus: [],
sendDisplayStatus: ['Checking'],
approvalDisplayStatus: ['Checking'],
},
'3': {
pullDisplayStatus: ['Approved'],
cancelDisplayStatus: [],
saveDisplayStatus: ['Pending'],
reviseDisplayStatus: [],
sendDisplayStatus: ['Pending'],
approvalDisplayStatus: ['Pending'],
},
}
const jsonForGlobal = this.GLOBAL2.jsonForGlobal;
const currentStatus = jsonForGlobal.detail[this.detailId].currentStatus;
const level = levels[jsonForGlobal.employeeLevel];
this.pullDisplay = level.pullDisplayStatus.indexOf(currentStatus) > -1;
this.cancelDisplay = level.cancelDisplayStatus.indexOf(currentStatus) > -1;
this.saveDisplay = level.cancelDisplayStatus.indexOf(currentStatus) > -1;
this.reviseDisplay = level.reviseDisplayStatus.indexOf(currentStatus) > -1;
this.sendDisplay = level.reviseDisplayStatus.indexOf(currentStatus) > -1;
If you use a property often it makes sense to introduce a local variable for it to clean things up:
const { employeeLevel, detail: { [this.detailId]: { currentStatus }}} = his.GLOBAL2.jsonForGlobal;
Secondly you don't need the if / else, you can just assign the boolean:
this.pullDisplay = (
employeeLevel == "1" && ["Checking", "Pending", "Approved"].includes(currentStatus) ||
employeeLevel == "2" && ["Pending", "Approved"].includes(currentStatus) ||
employeeLevel == "3" && currentStatus == "Approved"
)

How can I write this javascript logic code into a more efficient/compact way? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
In a project I am working on I have 21 buttons that all have active and inactive states. The state of certain buttons is affected by other buttons being pressed as well as that button being pressed. In my html I use ng-click to call a function updateActiveButtons(num) to activate or deactivate certain buttons.
The best way I could think of was to use an array of 21 elements, all of which were set to false by default and then changed when they were pressed.
The problem is that my code is UGLY and I know that there has to be a much better way to logic it out.
Here is my updateActiveButtons function:
/* Array for active buttons
0: Company Name 1: Country 2: Industry 3: Search 4: Company Name - Seller Name 5: Company Name - Buyer Name 6: Country - USA 7: Country - China 8: Country - Israel
9: Country - Russia 10: Country - India 11: Country - Japan 12: Industry - Tech 13: Industry - Consumer 14: Industry - Pharma 15: Industry - Financial 16: Industry - Biotech 17: Industry - Industrial
18: Date 19: Valuation 20: Industry - Business
*/
$scope.activeButtonArray = new Array(21);
for (var i = 0; i < $scope.activeButtonArray.length; i++) { $scope.activeButtonArray[i] = false; }
//pos = position in array
$scope.updateActiveButtons = function(pos) {
console.log($scope.activeButtonArray[20]);
if(pos != 0 || pos != 1 || pos != 2 || pos != 3 || pos != 4 || pos != 5) {
$scope.activeButtonArray[pos] = !$scope.activeButtonArray[pos];
} else if(pos == 3 && !$scope.activeButtonArray[pos]) {
$scope.activeButtonArray[pos] = true;
} else if(pos == 3 && $scope.activeButtonArray[pos]) {
$scope.activeButtonArray[pos] = false;
}
if(pos == 18 || pos == 19) {
$scope.activeButtonArray[0] = false;
if($scope.activeButtonArray[6] == false && $scope.activeButtonArray[7] == false && $scope.activeButtonArray[8] == false && $scope.activeButtonArray[9] == false && $scope.activeButtonArray[10] == false && $scope.activeButtonArray[11] == false) {
$scope.activeButtonArray[1] = false;
}
if($scope.activeButtonArray[12] == false && $scope.activeButtonArray[13] == false && $scope.activeButtonArray[14] == false && $scope.activeButtonArray[15] == false && $scope.activeButtonArray[16] == false && $scope.activeButtonArray[17] == false && $scope.activeButtonArray[20] == false) {
$scope.activeButtonArray[2] = false;
}
}
if(pos == 0) {
$scope.activeButtonArray[0] = true;
if($scope.activeButtonArray[4] || $scope.activeButtonArray[5]) {
$scope.activeButtonArray[0] = true;
}
if($scope.activeButtonArray[6] == false && $scope.activeButtonArray[7] == false && $scope.activeButtonArray[8] == false && $scope.activeButtonArray[9] == false && $scope.activeButtonArray[10] == false && $scope.activeButtonArray[11] == false) {
$scope.activeButtonArray[1] = false;
}
if($scope.activeButtonArray[12] == false && $scope.activeButtonArray[13] == false && $scope.activeButtonArray[14] == false && $scope.activeButtonArray[15] == false && $scope.activeButtonArray[16] == false && $scope.activeButtonArray[17] == false && $scope.activeButtonArray[20] == false) {
$scope.activeButtonArray[2] = false;
}
if($scope.search.text == undefined || $scope.search.text == '') {
$scope.activeButtonArray[3] = false;
}
}
if(pos == 1) {
if($scope.activeButtonArray[4] == false && $scope.activeButtonArray[5] == false) {
$scope.activeButtonArray[0] = false;
}
if($scope.activeButtonArray[6] == true || $scope.activeButtonArray[7] == true || $scope.activeButtonArray[8] == true || $scope.activeButtonArray[9] == true || $scope.activeButtonArray[10] == true || $scope.activeButtonArray[11] == true) {
$scope.activeButtonArray[1] = true;
}
if($scope.activeButtonArray[12] == false && $scope.activeButtonArray[13] == false && $scope.activeButtonArray[14] == false && $scope.activeButtonArray[15] == false && $scope.activeButtonArray[16] == false && $scope.activeButtonArray[17] == false && $scope.activeButtonArray[20] == false) {
$scope.activeButtonArray[2] = false;
}
if($scope.search.text == undefined || $scope.search.text == '') {
$scope.activeButtonArray[3] = false;
}
}
if(pos == 2) {
if($scope.activeButtonArray[4] == false && $scope.activeButtonArray[5] == false) {
$scope.activeButtonArray[0] = false;
}
if($scope.activeButtonArray[6] == false && $scope.activeButtonArray[7] == false && $scope.activeButtonArray[8] == false && $scope.activeButtonArray[9] == false && $scope.activeButtonArray[10] == false && $scope.activeButtonArray[11] == false) {
$scope.activeButtonArray[1] = false;
}
if($scope.activeButtonArray[12] == true || $scope.activeButtonArray[13] == true || $scope.activeButtonArray[14] == true || $scope.activeButtonArray[15] == true || $scope.activeButtonArray[16] == true || $scope.activeButtonArray[17] == true || $scope.activeButtonArray[20] == true) {
$scope.activeButtonArray[2] = true;
}
if($scope.search.text == undefined || $scope.search.text == '') {
$scope.activeButtonArray[3] = false;
}
}
if(pos == 3) {
if($scope.activeButtonArray[4] == false && $scope.activeButtonArray[5] == false) {
$scope.activeButtonArray[0] = false;
}
if($scope.activeButtonArray[6] == false && $scope.activeButtonArray[7] == false && $scope.activeButtonArray[8] == false && $scope.activeButtonArray[9] == false && $scope.activeButtonArray[10] == false && $scope.activeButtonArray[11] == false) {
$scope.activeButtonArray[1] = false;
}
if($scope.activeButtonArray[12] == false && $scope.activeButtonArray[13] == false && $scope.activeButtonArray[14] == false && $scope.activeButtonArray[15] == false && $scope.activeButtonArray[16] == false && $scope.activeButtonArray[17] == false && $scope.activeButtonArray[20] == false) {
$scope.activeButtonArray[2] = false;
}
}
if(pos == 4) {
$scope.activeButtonArray[4] = true;
$scope.activeButtonArray[5] = false;
}
if(pos == 5) {
$scope.activeButtonArray[4] = false;
$scope.activeButtonArray[5] = true;
}
}
I have a lot of repeated code that comes out in a way that just doesn't feel very well done or professional. I wouldn't be proud to send this to a client. Does anyone have any suggestions as to how I could make this better?
On way would be to replace entire conditions (or blocks) by methods/functions
so
if($scope.activeButtonArray[4] || $scope.activeButtonArray[5]) {
$scope.activeButtonArray[0] = true;
}
becomes
if (somethingIsSomething($scope))
This has the added benefit of be much more self-documenting so you can "read" what you're doing.
I liked pixelearth's recommendation to just create another function so I did.
I decided to make a function that took an array, a start, and a end point as parameters and return true if any of the array values in that range are true.
Here is the function:
var arrayContainsTrue = function(arr, start, end) {
for(var i = start; i <= end; i++) {
if(arr[i] == true) {
return true;
}
}
return false;
}
and then to shorten my code I just did this (with different start and end points based on what was needed):
if(!arrayContainsTrue($scope.activeButtonArray, 6, 11))

Categories