I cant understand one thing in the code below - why (limit) is in parenthesis?
import { Pipe, PipeTransform } from '@angular/core'
@Pipe ({
name: 'summary'
})
export class SummaryPipe implements PipeTransofm {
transform(value: string, limit?: number) {
if (!value)
return null;
let specificLimit = (limit) ? limit : 50;
return value.substr(0, specificLimit);
}
}
Thanks
Here a screenshot, to be sure I copied it right:

(limit) ? : 50;correctly? it seems to be an incorrect syntax(limit === 3) ? limit : 50