Can I use continue and break in Javascript for…in and for…of loops?

Yep – works in all loops. const myObject = { propA: ‘foo’, propB: ‘bar’ }; for (let propName in myObject) { console.log(propName); if (propName !== ‘propA’) { continue; } else if (propName === ‘propA’) { break; } } (By loops I mean for, for…in, for…of, while and do…while, not forEach, which is actually a function … Read more

Why is a function not an object?

A lot of the difference comes down to pointers and addressing. In C++ยน pointers to functions and pointers to objects are strictly separate kinds of things. C++ requires that you can convert a pointer to any object type into a pointer to void, then convert it back to the original type, and the result will … Read more

Java object destructuring

Java Language Architect Brian Goetz has recently talked about adding destructuring to an upcoming version of Java. Look for the Sidebar: pattern matching chapter in his paper: Towards Better Serialization I strongly dislike the current proposal of the syntax, but according to Brian your use case will look like the following (please note, that at … Read more

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