/ Published in: JavaScript
                    
                                        Quick and easy javascript in_array function. It's not perfect, but if you need something quick, this is it.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
 function in_array(needle, haystack) { for (var i=0, j=haystack.length; i < j; i++) { if (needle == haystack[i]) return true; } return false; }
Comments
                    Subscribe to comments
                
                