Skip to content
Advertisement

Tag: console.log

why console.log inside the useEffect runs twice

i’m currently working with react project, which gets data from api and show it on the console. although i wrote the console.log() just one time inside the useEffect hooks (with the [articles] dependency ), the web browser’s console.log always shows the console.log two times like this: enter image description here but i don’t know reason why.. in my thought when

How to find index of ‘items_tolookfor’ array of items in another nested Array List ‘nested_data’ in javascript

How to find index of ‘items_tolookfor’ array of items in another nested Array List ‘nested_data’ in javascript How would I find indices for ‘items_tolookfor’ in the nested array list ‘nested_data’ Also, the corresponding data lies in the nested list ‘nested_data’ index[2][5] I was trying this code: Expected result to be a console log output array with matching data for items_to_look_for

How to create user input in the JavaScript console?

I’m creating a short game in the JavaScript console, and for inspiration, I looked at google’s easter egg version (if you search text adventure then press f12 you can see it). I wanted input, the only way I could figure out how to have input was by having functions: But in google’s version, you can just type yes, and it

Button value output in console.log with JS

I’m fairly new to HTML and JS. I need the value of my HTML button to show in the console.log with JS. I dont want to use onclick=”…” though. This is part of my HTML file: This is my JS file: Answer 1) You have to add event listener on the html element not on the value of that element.

Display yellow warning message in console

I want to show a warning message in the Chrome console, like the highlighted item in this screenshot: console.log(message) displays a normal white message. console.error(message) creates an error message. But using console.warning(message) returns Uncaught TypeError: console.warning is not a function. So is there any way to present a console warning for JavaScript? It should be like this: But it doesn’t

Advertisement