I am trying to create an array with some values, then assign a variable a value contained in one of the arrays. I want to then return the name of the array if true.
I have got as far as the following (http://jsfiddle.net/4DhqW/1/)
<script>
var internal = 'WKF1';
Daily = [WKF1,WKF2,WKF3,WKF3,WKF4,WKF5];
Weekly = [WKF6,WKF7,WKF8];
Monthly = [WKF9,WKF10];
function frequency(wkf, array) {
if (wkf in //arrays daily weekly monthly ) {
return //array name
}
}
document.write(frequency(internal)); //this should return the name of the array
</script>
Can someone please guide me, thanks in advance.