Deleting array elements in JavaScript – delete vs splice

delete will delete the object property, but will not reindex the array or update its length. This makes it appears as if it is undefined: Note that it is not in fact set to the value undefined, rather the property is removed from the array, making it appear undefined. The Chrome dev tools make this distinction clear by printing empty when … Read more

stop all instances of node.js server

Windows Machine: Need to kill a Node.js server, and you don’t have any other Node processes running, you can tell your machine to kill all processes named node.exe. That would look like this: And if the processes still persist, you can force the processes to terminate by adding the /f flag: If you need more fine-grained control and … Read more

React Hook Warnings for async function in useEffect: useEffect function must return a cleanup function or nothing

I suggest to look at Dan Abramov (one of the React core maintainers) answer here: I think you’re making it more complicated than it needs to be. Longer term we’ll discourage this pattern because it encourages race conditions. Such as — anything could happen between your call starts and ends, and you could have gotten new … Read more

Get the values from the “GET” parameters (JavaScript)

JavaScript itself has nothing built in for handling query string parameters. Code running in a (modern) browser you can use the URL object (which is part of the APIs provided by browsers to JS):  Run code snippetExpand snippet For older browsers (including Internet Explorer), you can use this polyfill or the code from the original version of this answer that predates URL: You … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)