When your code is not working right and you have no idea what is wrong:
- What is the language ?
Yes, you heard me right, sometimes when you are writing javascript code inside a laravel/php page ..things could get mixed up - Remove the cache
There are lots of cache types you need to clear depending on what you have changed, here are some commands to use:- php artisan config:cache
- php artisan route:cache
- php artisan view:cache
- php artisan cache:clear
- php artisan clear-compiled
- composer dump-autoload
- php artisan debugbar:clear
- php artisan optimize
- What is the type of the variables ?
When you want to compare 2 variables and you are sure the result should be true, check the type of the variables, sometimes you could find that you are comparing a variable to an object or collection