În php I would use this to see if a variable is set and then use that value, otherwise make it a zero:
$pic_action = isset($_POST['pic_action']) ? $_POST['pic_action'] : 0;
But what is the equivalent in javascript?
I want to check if an element exists in the document, and then if it does, add it to the variable, otherwise add some other value to it, here is what I have so far:
var areaOption = document.getElementById("element");
Thanks