How can we extract formulas from cells using scripts?

how can we extract formulas from cells using scripts>

Cells have the properties Formula, FormulaLocal and ArrayFormula. CellRanges have the property FormulaArray. …
(FormulaLocal is showing the formula as it actually looks under the chosen UI language. Formula keeps the global version.)