Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Java Script Level 4 Lesson 8

System does not accept the code.
I believe it is correct. please help

let x = 10;
let y = 1;
let z;

(x > y)? z=x : z=y;
console.log("Value of z:" + z);
by

8 Answers

kshitijrana14
Try this one:

let x = 10;
let y = 1;
let z;
// your code comes here
(x > y)? z=x: z=y;
console.log("Value of z:" + z);
richard2022
nah did not work @kshitrana14
iamabhishek
What is the error message that you get?
richard2022
Hello Abhishek,
Thanks for reaching out.

exact message is:- "Use the ternary operator on line number number 5 with condition (x > y) "
Abhisheke3yvz
Hi, please check now, it should work.
richard2022
Hi Abhishek, Now it says code output does not match the expected result.
my code output is- "Value of z = 10"
richard2022
it has now been accepted Abhishek & Kshitij. Thank you
richard2022
Hello Abhishek and Kshitij - Please see my bug that i just reported.
https://www.studytonight.com/forum/bug-explore-css-course

Login / Signup to Answer the Question.