Most answered questions in Java

0 votes
0 answers

Javascript counting number of objects in object

I have an object something like: Object {0=Object, ...READ MORE

Nov 15, 2022 in Java by Nicholas
• 7,760 points
433 views
0 votes
0 answers

How to validate password using following conditions?

Password should contain At least one uppercase letter At ...READ MORE

Nov 15, 2022 in Java by Nicholas
• 7,760 points
217 views
0 votes
0 answers

How to create an array containing 1...N

I'm looking for alternatives to the following for creating a JavaScript array with values ranging from 1 to N, where N is only known at  runtime. var foo = []; for (var i = ...READ MORE

Nov 15, 2022 in Java by Nicholas
• 7,760 points
290 views
0 votes
0 answers

What is "callback hell" and how and why does RX solve it?

Can someone provide a precise description and ...READ MORE

Nov 9, 2022 in Java by Nicholas
• 7,760 points
393 views
0 votes
0 answers

Why were Javascript `atob()` and `btoa()` named like that?

A base64 string and window are both ...READ MORE

Nov 9, 2022 in Java by Nicholas
• 7,760 points
439 views
0 votes
0 answers

What is the difference between ( for... in ) and ( for... of ) statements?

I'm familiar with a for... in loop (it iterates over the keys), but this is the first I've heard of a for... of loop (it iterates over values). I don't understand the for...of loop. var arr = [3, 5, 7]; arr.foo ...READ MORE

Nov 9, 2022 in Java by Nicholas
• 7,760 points
204 views
0 votes
0 answers

How do you use the ? : (conditional) operator in JavaScript?

In simple words, what is the ?: ...READ MORE

Nov 9, 2022 in Java by Nicholas
• 7,760 points
364 views
0 votes
0 answers

How to round to at most 2 decimal places, if necessary

I'd like to round at most two ...READ MORE

Nov 9, 2022 in Java by Nicholas
• 7,760 points
524 views
0 votes
0 answers

What is the "debounce" function in JavaScript?

The JavaScript "debouncing" feature piques my attention. Unfortunately, the code is not presented in a way that I can comprehend.  How does it function (my comments are below)? I just do not understand how this works, to put it briefly. // Returns a function, ...READ MORE

Nov 8, 2022 in Java by Nicholas
• 7,760 points
228 views
0 votes
0 answers

javascript Image tag

I'm adding an image snapshot of a ...READ MORE

Nov 8, 2022 in Java by Nicholas
• 7,760 points
281 views
0 votes
0 answers

Difference between Relative path and absolute path in javascript

Have small clarifications, As of my knowledge, these ...READ MORE

Nov 8, 2022 in Java by Nicholas
• 7,760 points
404 views
0 votes
0 answers

What's the best way to convert a number to a string in JavaScript?

What method is the "best" for convert ...READ MORE

Nov 8, 2022 in Java by Nicholas
• 7,760 points
249 views
0 votes
0 answers

How can I get query string values in JavaScript?

Is there a method to retrieve query ...READ MORE

Nov 8, 2022 in Java by Nicholas
• 7,760 points
200 views
0 votes
0 answers

What 'type' of Language is JavaScript?

The structure of programming languages is frequently ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
371 views
0 votes
0 answers

What is the difference between "let" and "var"?

Although I've heard that it's referred to ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
387 views
0 votes
0 answers

How to convert decimal to hexadecimal in JavaScript

In JavaScript, how do you translate decimal ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
361 views
0 votes
0 answers

Generating random whole numbers in JavaScript in a specific range

How can I create random whole numbers ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
448 views
0 votes
0 answers

Generating PDF files with JavaScript

I was hoped that I could accomplish ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
299 views
0 votes
0 answers

What does document.forms mean in javascript?

What do the terms document.cookie, document.forms, and.value ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
360 views
0 votes
0 answers

Generate random number between two numbers in JavaScript

Is it possible to use JavaScript to ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
465 views
0 votes
0 answers

send images on whatsapp web with javascript DOM

I currently have the script that delivers ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
1,350 views
0 votes
0 answers

How to filter object array based on attributes?

The real estate house objects in my ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
397 views
0 votes
0 answers

Define a global variable in a JavaScript function

Can a global variable be defined in ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
362 views
0 votes
0 answers

How to sort an array of integers correctly

Trying to retrieve the greatest and lowest ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
442 views
0 votes
0 answers

What is event bubbling and capturing?

What is the distinction between event bubbling ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
264 views
0 votes
0 answers

creating list of objects in Javascript

Is it feasible to make a list ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
264 views
0 votes
0 answers

What is property in hasOwnProperty in JavaScript?

Consider: if (someVar.hasOwnProperty('someProperty') ) { // Do something(); } ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
269 views
0 votes
0 answers

How to add a class to a given element?

I already have a class for an element: <div class="someclass"> <img ... ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
216 views
0 votes
0 answers

window.onload vs document.onload

Which is more popular: window.onload or document.onload? READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
251 views
0 votes
0 answers

What is VanillaJS?

I have a simple query that has ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
481 views
0 votes
0 answers

How do I replace all occurrences of a string in JavaScript?

Given a string: s = "Test abc test ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
385 views
0 votes
0 answers

How to write palindrome in JavaScript

I'm wondering how to construct a palindrome ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
278 views
0 votes
0 answers

How do I copy to the clipboard in JavaScript?

How can I copy text to the ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
574 views
0 votes
0 answers

JavaScript Array splice vs slice

What is the distinction between splice and ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
356 views
0 votes
0 answers

Page Redirect after X seconds wait using JavaScript

After displaying an error notice, I need to redirect to a specified URL after 5 seconds.  First, I utilized Javascript as seen below. document.ready(window.setTimeout(location.href = "https://www.google.co.in",5000)); However, it is not ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
970 views
0 votes
0 answers

What is the difference between ' and " in JavaScript?

When creating strings in JavaScript, the character'or ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
243 views
0 votes
0 answers

How to play audio?

I'm creating a game using HTML5 and ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
207 views
0 votes
0 answers

How do I check if an array includes a value in JavaScript?

What is the shortest and most efficient ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
443 views
0 votes
0 answers

What is the !! (not not) operator in JavaScript?

I encountered some code that appears to ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
241 views
0 votes
0 answers

What is lexical scope?

What is a concise overview of lexical ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
246 views
0 votes
0 answers

How do you reverse a string in-place in JavaScript?

Without utilizing built-in methods (.reverse(),.charAt(), etc.), how ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
279 views
0 votes
0 answers

How to convert an Object {} to an Array [] of key-value pairs in JavaScript

I'd want to transform the following object: {"1":5,"2":7,"3":0,"4" ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
871 views
0 votes
0 answers

Convert javascript array to string

I'm attempting to loop through a "value" ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
302 views
0 votes
0 answers

Javascript call() & apply() vs bind()?

I'm already aware that apply and calls are functions that do the same thing (context of a function). The distinction is in how we communicate the arguments (manual vs array). When should I, however, utilize the bind() method? var obj = { x: ...READ MORE

Sep 22, 2022 in Java by Nicholas
• 7,760 points
349 views
0 votes
0 answers

How to convert a string to an integer in JavaScript?

In JavaScript, how do I convert a ...READ MORE

Sep 22, 2022 in Java by Nicholas
• 7,760 points
312 views
0 votes
0 answers

What does [object Object] mean? (JavaScript)

One of my notifications had the follo ...READ MORE

Sep 22, 2022 in Java by Nicholas
• 7,760 points
318 views
0 votes
0 answers

Remove duplicate values from JS array

I have a pretty simple JavaScript arr ...READ MORE

Sep 22, 2022 in Java by Nicholas
• 7,760 points
486 views
0 votes
0 answers

What is lexical scope?

What is a quick overview of lexical ...READ MORE

Sep 22, 2022 in Java by Nicholas
• 7,760 points
352 views
0 votes
0 answers

How do I format a date in JavaScript?

How can I convert a Date object ...READ MORE

Sep 21, 2022 in Java by Nicholas
• 7,760 points
289 views
0 votes
0 answers

For-each over an array in JavaScript

How can I use JavaScript to loop ...READ MORE

Sep 21, 2022 in Java by Nicholas
• 7,760 points
328 views