JavaScript Environment · React Native
CodeECMAScript 5Reserved WordsECMAScript 2015 (ES6)Arrow functionsBlock scopingCall spreadClassesComputed PropertiesConstantsDestructuringfor…ofFunction NameLiteralsModulesObject Concise MethodObject Short NotationParametersRest ParamsShorthand PropertiesSticky RegexTemplate LiteralsUnicode RegexECMAScript 2016 (ES7)Exponentiation OperatorECMAScript 2017 (ES8)Async FunctionsFunction Trailing CommaECMAScript 2018 (ES9)Object SpreadECMAScript 2019 (ES10)Optional Catch BindingECMAScript 2020 (ES11)Dynamic ImportsNullish Coalescing OperatorOptional ChainingECMAScript 2022 (ES13)Class FieldsStage 1 ProposalExport Default FromMiscellaneousBabel TemplateFlowESM to CJSJSXObject AssignReact Display NameTypeScript
promise.catch(function() {...});
<C onPress={() => this.setState({pressed: true})} />
class C extends React.Component {render() { return <View />; }}
const key = 'abc'; const obj = {[key]: 10};
const {isActive, style} = this.props;
for (var num of [1, 2, 3]) {...};
const b = 0b11; const o = 0o7; const u = 'Hello\u{000A}\u{0009}!';
import React, {Component} from 'react';
const obj = {method() { return 10; }};
const name = 'vjeux'; const obj = {name};
function test(x = 'hello', {a, b}, ...args) {}
function(type, ...args) {};
const who = 'world'; const str = `Hello ${who}`;
const string = 'foo💩bar'; const match = string.match(/foo(.)bar/u);
async function doStuffAsync() {const foo = await doOtherStuffAsync();};
const extended = {...obj, a: 10};
try {throw 0; } catch { doSomethingWhichDoesNotCareAboutTheValueThrown();}
const package = await import('package'); package.function()
const foo = object.foo ?? 'default';
const name = obj.user?.name;
class Bork {static a = 'foo'; static b; x = 'bar'; y;}
template(`const %%importName%% = require(%%source%%);`);
function foo(x: ?number): string {};
<View style={{color: 'red'}} />
const bar = createReactClass({});
function foo(x: {hello: true, target: 'react native!'}): string {};