Added
An analytics service receives JSON records with a timestamp string and a list of line items. It must produce a new array containing only records newer than a configured cutoff and with at least one positive-quantity item, while leaving the input response unchanged. The payload can contain missing line-item arrays, and the timestamp strings are ISO 8601 values. Which two implementation choices meet these requirements? (Choose two.)
Date.parse converts ISO 8601 timestamps to numeric time values that can be compared with a cutoff represented in the same way. filter creates a new array, and lineItems?.some(...) safely handles a missing array while checking for a positive quantity. Sorting mutates the input and does not itself implement both predicates. Mapping to null retains nonqualifying positions and returns the original array when that is what the code returns. Directly calling some fails when lineItems is missing, and lexical comparison is less robust than comparing parsed instants.