Web API untuk Angular - CRUDPRO

Web API untuk Angular

Web API untuk Angular

1. Kondisi True :

//Longhand
if(booleanVar === true){}
//Shorthand
if(booleanVar){}

2. Arrow Function :

//Longhand
function data(name){
console.log(name)
}
//Shorthand
const data = name =>console.log(name)

3. Template Literals :

const name = "Rajesh";
const day = "Sunday";
const data = "Hello " + name + "Have a wonderful " + day + "!";
<pre style="background-color: transparent; border: medium none;"><code class="javascript">const name = &quot;Rajesh&quot;;
const day = &quot;Sunday&quot;;
const data = &quot;Hello &quot; + name + &quot;Have a wonderful &quot; + day + &quot;!&quot;;</code></pre>

4. Power of any number :

//Longhand
Math.pow(3,6)
//Shorthand
3**6

5. Assignment operator :

//Longhand
x = x+y;
x = x-y;
//Shorthand
x += y;
x -= y;

6. Deklarasi Variables :

//Longhand
let x;
let y;
let z = 'a';
//Shorthand
let x,y,z = 'a';

7. Ternary Operator :

//Longhand
let isAdult;
if(age>17){
  isAdult = true;
}else {
isAdult = false;
}
//Shorthand
let isAdult = age >17 ? true :false;