Click here to Skip to main content
15,886,919 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionJqxTree control is taking time to load with 500 records Pin
yadta6-Feb-24 18:57
yadta6-Feb-24 18:57 
AnswerRe: JqxTree control is taking time to load with 500 records Pin
Richard Deeming6-Feb-24 21:33
mveRichard Deeming6-Feb-24 21:33 
GeneralRe: JqxTree control is taking time to load with 500 records Pin
jschell7-Feb-24 5:40
jschell7-Feb-24 5:40 
AnswerRe: JqxTree control is taking time to load with 500 records Pin
Prestige Somerville live27-Mar-24 20:10
Prestige Somerville live27-Mar-24 20:10 
Questionpassing 0 to a function Pin
mike741112-Jan-24 1:53
mike741112-Jan-24 1:53 
AnswerRe: passing 0 to a function Pin
Richard Deeming12-Jan-24 2:14
mveRichard Deeming12-Jan-24 2:14 
AnswerRe: passing 0 to a function Pin
Richard MacCutchan12-Jan-24 3:08
mveRichard MacCutchan12-Jan-24 3:08 
GeneralRe: passing 0 to a function Pin
mike741112-Jan-24 10:00
mike741112-Jan-24 10:00 
GeneralRe: passing 0 to a function Pin
Dave Kreskowiak12-Jan-24 12:46
mveDave Kreskowiak12-Jan-24 12:46 
That code does not output what you/she says it does.

The first console.log statement will output 'undefined'.

The second will output 'One digit: ${x}'.

The third will output 'Two digit: ${x}'.

and the last will output 'The number is: ${x}'.

The 'undefined' is output because none of the cases in the switch block met any criteria so it fell through to the last (and non-existent) statement in the numberDigits function. There is no return statement there either, so the function ends without returning anything. Javascript will set the 'return value' to undefined, or null in other languages. Other languages will just crash or not even compile, but since javascript is interpreted, it can get away with an undefined return value.

GeneralRe: passing 0 to a function Pin
Richard MacCutchan12-Jan-24 22:08
mveRichard MacCutchan12-Jan-24 22:08 
GeneralRe: passing 0 to a function Pin
mike741113-Jan-24 0:48
mike741113-Jan-24 0:48 
GeneralRe: passing 0 to a function Pin
Richard MacCutchan13-Jan-24 1:55
mveRichard MacCutchan13-Jan-24 1:55 
GeneralRe: passing 0 to a function Pin
Dave Kreskowiak13-Jan-24 3:52
mveDave Kreskowiak13-Jan-24 3:52 
AnswerRe: passing 0 to a function Pin
Jeremy Falcon31-Jan-24 7:14
professionalJeremy Falcon31-Jan-24 7:14 
QuestionHow to Reference a local image file to display it Pin
Tom Mort31-Dec-23 7:00
Tom Mort31-Dec-23 7:00 
AnswerRe: How to Reference a local image file to display it Pin
Richard MacCutchan31-Dec-23 21:42
mveRichard MacCutchan31-Dec-23 21:42 
GeneralRe: How to Reference a local image file to display it Pin
Tom Mort1-Jan-24 6:17
Tom Mort1-Jan-24 6:17 
GeneralRe: How to Reference a local image file to display it Pin
jkirkerx1-Jan-24 13:26
professionaljkirkerx1-Jan-24 13:26 
GeneralRe: How to Reference a local image file to display it Pin
Tom Mort1-Jan-24 14:24
Tom Mort1-Jan-24 14:24 
GeneralRe: How to Reference a local image file to display it Pin
jkirkerx1-Jan-24 17:32
professionaljkirkerx1-Jan-24 17:32 
GeneralRe: How to Reference a local image file to display it Pin
DALLAS SENSIE8-Apr-24 15:45
DALLAS SENSIE8-Apr-24 15:45 
Questiondrop down list and submit button Pin
prasad penkey4-Dec-23 2:33
prasad penkey4-Dec-23 2:33 
AnswerRe: drop down list and submit button Pin
Richard MacCutchan4-Dec-23 3:08
mveRichard MacCutchan4-Dec-23 3:08 
AnswerRe: drop down list and submit button Pin
Andre Oosthuizen5-Dec-23 8:50
mveAndre Oosthuizen5-Dec-23 8:50 
GeneralRe: drop down list and submit button Pin
Richard Deeming5-Dec-23 22:05
mveRichard Deeming5-Dec-23 22:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.