H Hằng Đoàn New member Sep 19, 2021 #1 What will be the output of the following JavaScript code? Code: function output(object) { var place=object ? object.place : “Italy”; return “clean:”+ place; } console.log(output({place:India})); A. clean:India B. clean:Italy C. error D. undefined
What will be the output of the following JavaScript code? Code: function output(object) { var place=object ? object.place : “Italy”; return “clean:”+ place; } console.log(output({place:India})); A. clean:India B. clean:Italy C. error D. undefined
N Ngọc Trâm New member Sep 19, 2021 #2 Answer: a Explanation: ”?” operator is used to compare the values and place is initialized according to the true condition that whether it is true or false. The function is called in the console.log and the object value is passed. Upvote 0 Downvote
Answer: a Explanation: ”?” operator is used to compare the values and place is initialized according to the true condition that whether it is true or false. The function is called in the console.log and the object value is passed.