What is the difference between call and apply? What is the difference between using call and apply to invoke a function? var func = function(){ alert('hello!'); }; func.apply(); vs func.call(); Are there performance differences between the two methods? When is it best to use call over apply and vice versa? Solution: The difference is that apply lets you invoke the function with arguments as an array; call requires the parameters be listed explicitly. A useful mnemonic is "A for array and C for comma." See MDN's documentation on apply and call. Pseudo
undefined
JavaScript function declaration syntax: var fn = function() {} vs function fn() {} I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent. The previous developer uses two ways of declaring functions and I can't work out if there is a reason behind it or not. The two ways are: var functionOne = function() { // Some code }; function functionTwo() { // Some code } What
undefined
How can I find unused functions in a PHP project How can I find unused functions in a PHP project? Are there features or API's built into PHP that will allow me to analyse my codebase - for example Reflection, token_get_all()? Are these API's feature rich enough for me not to have to rely on a third party tool to perform this type of analysis? Answer : Thanks Greg and Dave for the feedback. Wasn't quite what I was looking for, but I decided to