My initial array:
const result = [ 'FirstName', 'AllocId', 'JobTitle', 'SalaryCat' ]
Expected result:
[
'CASE WHEN FirstName is NULL AND AllocId is NOT NULL then '(blank)' ELSE FirstName END as FirstName',
'CASE WHEN AllocId is NULL AND JobTitle is NOT NULL then '(blank)' ELSE AllocId END as AllocId',
'CASE WHEN JobTitle is NULL AND SalaryCat is NOT NULL then '(blank)' ELSE JobTitle END as JobTitle',
]
I just want to create this form of string based on next index values and avoid the last index.
2