mirror of
https://github.com/jorgevasquezp/AFX_yTools.git
synced 2026-09-16 19:22:42 +00:00
18 lines
473 B
React
18 lines
473 B
React
if (Array.prototype.getOne==null) Array.prototype.getOne=function(item){ //Extends the Array class with the getOne functions wich
|
|||
|
|
var val = -1;
|
||
|
|
for(i=0;i<=this.length;i++){
|
||
|
|
if(this[i]==item){
|
||
|
|
var val = i;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return val;
|
||
|
|
}
|
||
|
|
function yFactor(n,f){
|
||
|
|
if((typeof(n)=='number'&&typeof(f)=='number')&&(n>f)){
|
||
|
|
value = n - (n%f);
|
||
|
|
return(value);
|
||
|
|
}else{
|
||
|
|
alert('error');
|
||
|
|
}
|
||
|
|
}
|