JavaScript Environment · React Native
promise.catch(function() {...});
<C onPress={() => this.setState({pressed: true})} />
let greeting = 'hi';
Math.max(...array);
class C extends React.Component {render() { return <View />; }}
const key = 'abc'; const obj = {[key]: 10};
const answer = 42;
const {isActive, style} = this.props;
for (var num of [1, 2, 3]) {...};
let number = x => x;
const b = 0b11; const o = 0o7; const u = 'Hello\u{000A}\u{0009}!';
import {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 o = {a, b, c};
const a = /o+/y;
const who = 'world'; const str = `Hello ${who}`;
const string = 'foo💩bar'; const match = string.match(/foo(.)bar/u);
let x = 10 ** 2;
async function doStuffAsync() {const foo = await doOtherStuffAsync();};
function f(a, b, c,) {};
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;}
export v from 'mod';
template(`const %%importName%% = require(%%source%%);`);
function foo(x: ?number): string {};
export default 42;
<View style={{color: 'red'}} />
Object.assign(a, b);
const bar = createReactClass({});
function foo(x: {hello: true, target: 'react native!'}): string {};