Javascript Ternary operator problems

Write a function that accepts base (decimal), height (decimal) and shape (“triangle”, “parallelogram”) as input and calculates the area of that shape. solve this using ternary operator in Javascript.