FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodejs-code-samples/27.function_declaration_vs_expression.js at master · shovon8/nodejs-code-samples · GitHub
shovon8
/
nodejs-code-samples
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodejs-code-samples
/
27.function_declaration_vs_expression.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (17 loc) · 618 Bytes
Breadcrumbs
nodejs-code-samples
/
27.function_declaration_vs_expression.js
Copy path
File metadata and controls
25 lines (17 loc) · 618 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
* JDKJS:
* The easiest way to distinguish declaration vs. expression is the
position of the word function in the statement (not just a line,
but a distinct statement). If function is the very first thing in
the statement, then it’s a function declaration. Otherwise, it’s a
function expression
* */
// Example 120 - Function Declaration vs Expression
// this is a function declaration
function
printHello
(
)
{
console
.
log
(
"Hello"
)
;
}
// this is a function expression, because 'function' is not the very first thing in the statement
(
function
printHelloWorld
(
)
{
console
.
log
(
"Hello World"
)
;
}
)
(
)
;
Back
|
FazBrowse Home
|
New Git URL