Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 391 Bytes

Destructuring.md

File metadata and controls

22 lines (17 loc) · 391 Bytes

Destructuring

Destructuring

const tplData: {a: number, difftime?: number, c?: 1} = {a: 1};

const {
    difftime = 8,
    a,
    c: y = 1
} = tplData;

const c = tplData.a;
$tplData = array( "a" => 1 );
$difftime = isset($tplData["difftime"]) ? $tplData["difftime"] : 8; $a = $tplData["a"]; $y = isset($tplData["c"]) ? $tplData["c"] : 1;
$c = $tplData["a"];