Some handy tips and tricks of JavaScript!
Some handy tips and tricks of JavaScript!
@thecodecrumbs ~$ '
www.codecrumbs.com ~
Q JavaScript
// Regular Function
let myCustomFunction = function() {}
// Arrow Function
let myCustomFunction = () => {}
@thecodecrumbs Q1
www.codecrumbs.com
Q JavaScript
[ 2 , 15 , 3 ] . sort() //[15, 2, 3]
[ 1 , 2 , 3 ] . reverse () //[3, 2, 1]
@thecodecrumbs
www.codecrumbs.com
Q JavaScript
@thecodecrumbs
www.codecrumbs.com
Q JavaScript
String Methods
The + Operator
canst str = ' Hello ' + ' ' + ' World '
//Hello World
Array.join( )
[ 'Hello ' , ' ' , ' World' ] .join ( '' )
//Hello World
@thecodecrumbs
www.codecrumbs.com
Q JavaScript
String Methods
String.concat()
canst st r1 = ' Hello '
canst st r2 = str 1 . concat ( ' ' World' )
//Hello World
Template Literals
canst str 1 = ' Hello'
' ${ st r1 } World "
//Hello World
@thecodecrumbs
www.codecrumbs.com
How many do
you know?
@thecodecrumbs
www.codecrumbs.com