From the course: Firebase Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Write Cloud Functions in ES6+ syntax

Write Cloud Functions in ES6+ syntax - Google Cloud Tutorial

From the course: Firebase Essential Training

Start my 1-month free trial

Write Cloud Functions in ES6+ syntax

- [Instructor] Now, you may have noticed when we looked at the hello world example function provided for us by Firebase that the code here was written in older JavaScript syntax, that is, using require and module exports. And that's because by default, cloud functions don't currently support ES6 syntax and beyond, similar to Node.JS. Now this older syntax also extends into things like async, await, and other things we're only allowed to do with later versions of JavaScript, which cloud functions will complain about if we try and use. And this is a little bit annoying, since, well, the rest of our application is written in modern JavaScript. So you might be wondering if there's a way to write our functions using ES6+ syntax instead of being stuck writing our functions with older JavaScript. Well, fortunately the answer here is a resounding yes. Now the first way to do this would be to use TypeScript. If you remember when…

Contents