Clearer here would be inputs[ condition ? "true" : "false"] and possibly a little more efficient too