Skip to content

Tag: javascript

What’s the difference between Object.entries and Object.keys?

What’s the difference between Object.entries and Object.keys? In which case should I use one or the other one? Answer Object.keys returns only the own property names and works for ES5. Object.entries returns an array of arrays with key and value and works from ES6. If you need only keys or like to filte…

Typescript: Object is possibly ‘undefined’

I’m curious as to why I would be getting a Typescript warning below. There error appears on this line: a[k].toString().toLowerCase() However I have the check if (a && a[k]) which should ensure that in the next line, a and a[k] cannot be undefined? This is the shape of the IAsset interface tsconf…

PHP Post radio value to next page on radio click

I need some help with my code as I have got a problem with posting the value. When I click on the radio, it will not post the data when it redirect me to secondpage.php. I want to post the value when I click on the radio button to take me to the next page. firstpage.php secondpage.php It will show