You need to sign in to do that
Don't have an account?
Ankit Saxena
Clarity with Console.log
Hello...
I have written up my console statment in javascript controller as
console.log('return' +response.getReturnValue());
1. Not sure, if this is correct or not. If not, then what is the correct step. ?
2. Its giving log as below where i cant see 'return' text in not present in the log though it return the 5 records i am expecting. Am i missing something?
I have written up my console statment in javascript controller as
console.log('return' +response.getReturnValue());
1. Not sure, if this is correct or not. If not, then what is the correct step. ?
2. Its giving log as below where i cant see 'return' text in not present in the log though it return the 5 records i am expecting. Am i missing something?
console.log('return' +response.getReturnValue()) --- > This statement is correct you can use event differnt ways
1. Not sure, if this is correct or not. If not, then what is the correct step. ? -- Statment is correct and you can use as below also to print as JSON
2. Its giving log as below where i cant see 'return' text in not present in the log though it return the 5 records i am expecting. Am i missing something?
Console.log will print the value to the browser and its same like System.debug and not required any return statement to print the value
1. It looks good to me.
2. This is strage, I tried with same script for console log but it returned with string in console. May be the Returnvalue structure is differnent in your case I see
if you write as system.debug('return:'+return); and if value of return is 5; so it will be displayed as return:5. 'return' keyword will be there in debug log.
but as you can see here, there is no 'return' keyword but only output. so my question was why ? Did i missed out anything?
if you write as system.debug('return:'+return); and if value of return is 5; so it will be displayed as return:5. 'return' keyword will be there in debug log.
but as you can see here, there is no 'return' keyword but only output.