Here is part of code. I need to understand what this code do :
if instruction == "JOINT" or instruction == "ROOT":
    parent = joint_stack[-1] if instruction == "JOINT" else None
    joint = BvhJoint(words[1], parent)
    self.joints[joint.name] = joint
How to understand this line special ->
    parent = joint_stack[-1] if instruction == "JOINT" else None
Is this code equal with JS code:
if (instruction == "JOINT") {
    parent = joint_stack[-1];
} else {
}
?
 
     
     
     
    