I'm new in using jquery and i would like to ask what do you call this kind of statement where I want to add an If Statement inside
btw. the Read here is Boolean and i want to change if Read == true read: 'read' and if false it becomes unread: 'unread'
This is my Original code:
var options = { id: ID,
read: Read == true ? 'unread' : 'read',
category: "projects",
message: Message
};
and my Trial but didn't succeeded :
var options = {
if(Read == true) {
id: ID,
read: 'read',
category: "projects",
message: Message
}
else {
id: ID,
unread: 'unread',
category: "projects",
message: Message
}
};
having expected identifier or string in the if word
Thanks in Advance