What is the use of -1 in instructorAccts.push(_address) -1?
function setInstructor(address _address, uint _age, string _fName, string _lName) public {
var instructor = instructors[_address];
instructor.age = _age;
instructor.fName = _fName;
instructor.lName = _lName;
instructorAccts.push(_address) -1;
}
-1
was blindly copied from another example.push()-1
corresponds to the row in the array occupied by the appended element. As @goodvibration points out, the result of this work isn't assigned to anything (e.g.uint position = array.push(value) -1
) so the extra work is pointless.