I tried this in my code and also in the Chrome console and it's not doing what I want. Do you know why it's not working?
let r = 'd';
r == 'e' ? console.log('itisE') :
r == 'd' ? console.log('itisD') : console.log('nothing');
Chrome's console prints "undefined", it doesn't execute the function calls. Neither does my code (in my code, it's for UI changes of various buttons).
I assume that you are talking about in the google chrome browser -> developer tools and then the console inside them.
the console works in a way that it has to return/print any value to you, in this case, the let r = 'd' its not printing anything, for that reason shows undefined; becasue the console always does a Console.log() on the background.
and when you assign a value you are not really printing/returning anything, thats why you see undefined;