I need some help with my JS logic here. So basically I am getting a bunch of permissions and storing them as follows:
for( var i=0 ; i<permissions.length ; i++ ) {
p[permissions[i].PERMISSION] = true;
}
The values of the permissions are as follows
p.SELECT_USER,
p.INSERT_USER,
p.UPDATE_USER, etc and so on
Now I want to display/hide a window based on the value of permissions. I need some logic help in my if condition So basically I want something like,
if( 'permissions beigns with the word SELECT' && 'permissions does not begin with any other word' ) {
this.window.hide()
} else {
this.window.show()
}
is there any efficient way I cant do this by modifying my for loop?