Javascript Conditional Operator Question 1

Introduction

What is the output of the following code:


let yourname = "CSS";

let result = (yourname.length > 10) ? function(){
     console.log("you have a long name!");
     return "long";
}() : function(){console.log("you have a short name!");return "short";}()


you have a short name!



PreviousNext

Related