Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js () = >

/**
I think that you might be looking for 
the js "arrow function"; I hope that 
this example below helps ;)
**/ 

// usual function
function fartOne(){
    console.log('Pooofff... pof.. ppf.. poof.. p');
}

// arrow function to do the same
const fartTwo = () => console.log('Baaaf... paf.. poof.. poffie.. plop');

// call the functions to test 'em out..
fartOne();
fartTwo();
Comment

javascript =>

// Javascript => is called Arrow Function: A short syntax for functions

hello1 = function(name) {
  return "Hello " + name + "!";
} // can be replaced with arrow function. See below.

hello2 = (name) => { return "Hello " + name + "!"; } // Arrow Function =>

hello3 = (name) => "Hello " + name + "!"; // Even shorter =>

console.log(hello1("Alice"), hello2("Bob"), hello3("Ada"))
Comment

js >>

// binary 

const a = 5;          //  00000000000000000000000000000101
const b = 2;          //  00000000000000000000000000000010
const c = -5;         //  11111111111111111111111111111011

console.log(a >> b);  //  00000000000000000000000000000001
// expected output: 1

console.log(c >> b);  //  11111111111111111111111111111110
// expected output: -2

Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript array cheatsheet 
Javascript :: for loop javascript array of objects 
Javascript :: polymorphism js 
Javascript :: hello world js 
Javascript :: javascript change checkbox state 
Javascript :: .reverse javascript string 
Javascript :: how to take input from user in javascript console 
Javascript :: loop js 
Javascript :: vuejs methods 
Javascript :: how to make a discord bot delete messages after time js 
Javascript :: hello world in react 
Javascript :: instance of javascript 
Javascript :: _.union 
Javascript :: oridnal suffix 
Javascript :: javascript DOM SELECT 
Javascript :: javascript declare variables 
Javascript :: JavaScript built-in methods 
Javascript :: javascript Multiline Strings Using Template Literals 
Javascript :: freecodecamp javascript basic step quoting string 
Javascript :: JavaScript Validation API 
Javascript :: jQuery - Set 
Javascript :: single page application example javascript 
Javascript :: javascript equality operator 
Javascript :: phaser place on triangle 
Javascript :: phaser animation show on start 
Javascript :: remove text in div JQuery zqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq 
Javascript :: javascript 2021 
Javascript :: vue mount modal to body 
Javascript :: javascript replace all with variable 
Javascript :: password 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =