Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Arrow functions by Codeacademy

// Arrow function with two arguments 
const sum = (firstParam, secondParam) => { 
  return firstParam + secondParam; 
}; 
console.log(sum(2,5)); // Prints: 7 
 
// Arrow function with no arguments 
const printHello = () => { 
  console.log('hello'); 
}; 
printHello(); // Prints: hello
 
// Arrow functions with a single argument 
const checkWeight = weight => { 
  console.log(`Baggage weight : ${weight} kilograms.`); 
}; 
checkWeight(25); // Prints: Baggage weight : 25 kilograms.
 
 
// Concise arrow functions
const multiply = (a, b) => a * b; 
console.log(multiply(2, 30)); // Prints: 60
Comment

PREVIOUS NEXT
Code Example
Javascript :: showing error for few seconds react 
Javascript :: api dfetch data in reactjs 
Javascript :: data structures with javascript 
Javascript :: dynamically create html table in javascript 
Javascript :: JavaScript Normalized and UnNnormalized URL 
Javascript :: Get client or user ip address in react using axios 
Javascript :: Allowed Blocks in Nested Blocks Component Wordpress 
Javascript :: default parameters in es6 
Javascript :: how to calculate time difference in js 
Javascript :: javascript for dummies 
Javascript :: js regexp eth wallet 
Javascript :: react-navigation: Detect when screen, tabbar is activated / appear / focus / blur 
Javascript :: Parents, Children & Siblings 
Javascript :: mdn javascript console.log(Math.random()); 
Javascript :: how is react different from normal js 
Javascript :: Find all objects in different levels of JSON 
Javascript :: const isEnabled = !Object.keys(errors).some(x = errors[x]); 
Javascript :: highcharts react hide data point dots 
Javascript :: js detect where function call came from 
Javascript :: amcharts 3d column chart export 
Javascript :: how concatenate arrays in es6 
Javascript :: lodash uniqBy alterantive in js 
Javascript :: ProgressBar from color to color 
Javascript :: custom render contenful rich text rendering 
Javascript :: how to change a react link icon when you send the link as message in whatsapp 
Javascript :: khai bao bien js 
Javascript :: early exit js 
Javascript :: Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse 
Javascript :: how to trigger on Blur only when clicked outside parent component and not child component in react js 
Javascript :: js convert charcode to char 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =