Static Functions

2 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€85.49
List Price:  €119.70
You save:  €34.20
£74.12
List Price:  £103.78
You save:  £29.65
CA$136.71
List Price:  CA$191.41
You save:  CA$54.69
A$152.23
List Price:  A$213.13
You save:  A$60.89
S$128.04
List Price:  S$179.26
You save:  S$51.22
HK$784.91
List Price:  HK$1,098.91
You save:  HK$313.99
CHF 79.62
List Price:  CHF 111.47
You save:  CHF 31.85
NOK kr1,010.40
List Price:  NOK kr1,414.60
You save:  NOK kr404.20
DKK kr638.01
List Price:  DKK kr893.25
You save:  DKK kr255.23
NZ$166.83
List Price:  NZ$233.57
You save:  NZ$66.74
د.إ367.26
List Price:  د.إ514.18
You save:  د.إ146.92
৳12,155.75
List Price:  ৳17,018.53
You save:  ৳4,862.78
₹8,596.36
List Price:  ₹12,035.26
You save:  ₹3,438.89
RM425.20
List Price:  RM595.30
You save:  RM170.10
₦153,097.68
List Price:  ₦214,342.88
You save:  ₦61,245.20
₨28,434.65
List Price:  ₨39,809.65
You save:  ₨11,375
฿3,238.52
List Price:  ฿4,534.06
You save:  ฿1,295.54
₺4,019.29
List Price:  ₺5,627.17
You save:  ₺1,607.88
B$555.95
List Price:  B$778.35
You save:  B$222.40
R1,785.64
List Price:  R2,499.97
You save:  R714.33
Лв167.37
List Price:  Лв234.32
You save:  Лв66.95
₩138,035.24
List Price:  ₩193,254.86
You save:  ₩55,219.61
₪336.32
List Price:  ₪470.86
You save:  ₪134.54
₱5,662.23
List Price:  ₱7,927.35
You save:  ₱2,265.11
¥14,719.04
List Price:  ¥20,607.25
You save:  ¥5,888.20
MX$1,867.78
List Price:  MX$2,614.97
You save:  MX$747.18
QR364.02
List Price:  QR509.64
You save:  QR145.62
P1,334.67
List Price:  P1,868.59
You save:  P533.92
KSh12,918.70
List Price:  KSh18,086.70
You save:  KSh5,168
E£4,944.50
List Price:  E£6,922.50
You save:  E£1,977.99
ብር13,688.63
List Price:  ብር19,164.63
You save:  ብር5,476
Kz91,186.38
List Price:  Kz127,664.58
You save:  Kz36,478.20
CLP$95,820.41
List Price:  CLP$134,152.41
You save:  CLP$38,332
CN¥716.71
List Price:  CN¥1,003.43
You save:  CN¥286.71
RD$6,029.39
List Price:  RD$8,441.39
You save:  RD$2,412
DA13,004.72
List Price:  DA18,207.13
You save:  DA5,202.41
FJ$224.44
List Price:  FJ$314.23
You save:  FJ$89.78
Q767.92
List Price:  Q1,075.11
You save:  Q307.19
GY$20,914.76
List Price:  GY$29,281.51
You save:  GY$8,366.74
ISK kr12,176.78
List Price:  ISK kr17,047.98
You save:  ISK kr4,871.20
DH900.15
List Price:  DH1,260.25
You save:  DH360.10
L1,693.89
List Price:  L2,371.51
You save:  L677.62
ден5,262.76
List Price:  ден7,368.08
You save:  ден2,105.31
MOP$808.30
List Price:  MOP$1,131.65
You save:  MOP$323.35
N$1,772.82
List Price:  N$2,482.02
You save:  N$709.20
C$3,674.63
List Price:  C$5,144.63
You save:  C$1,470
रु13,711.85
List Price:  रु19,197.15
You save:  रु5,485.29
S/354.61
List Price:  S/496.47
You save:  S/141.86
K412.45
List Price:  K577.45
You save:  K165
SAR374.98
List Price:  SAR524.99
You save:  SAR150
ZK2,314.16
List Price:  ZK3,239.92
You save:  ZK925.75
L434.44
List Price:  L608.23
You save:  L173.79
Kč2,108.91
List Price:  Kč2,952.57
You save:  Kč843.65
Ft34,214.75
List Price:  Ft47,902.02
You save:  Ft13,687.27
SEK kr958.89
List Price:  SEK kr1,342.49
You save:  SEK kr383.59
ARS$126,065.09
List Price:  ARS$176,496.17
You save:  ARS$50,431.08
Bs692.26
List Price:  Bs969.19
You save:  Bs276.93
COP$401,329.80
List Price:  COP$561,877.77
You save:  COP$160,547.97
₡50,416.70
List Price:  ₡70,585.39
You save:  ₡20,168.69
L2,634.73
List Price:  L3,688.73
You save:  L1,054
₲774,763.12
List Price:  ₲1,084,699.36
You save:  ₲309,936.24
$U4,064.43
List Price:  $U5,690.36
You save:  $U1,625.93
zł364.14
List Price:  zł509.81
You save:  zł145.67
Already have an account? Log In

Transcript

Hello, in this JavaScript video, I'm going to show you the static keyword. And we're going to use it to create a static function versus static function static function on like any other function set function like a million times in the last 10 seconds is one that doesn't require an object of the class to be created to be able to access it like you know, it does, right? Yeah. So if, for example, I just use the name of the class, or do dot epic fun. Save that run it, we get an error. Fifth quarter epic font is not a function.

And that's because epic fun needs to have an object created. Whereas if I create a number function, and to create static function, to static, don't call it that take fun. And again, as with any other function, as I covered in the following video of this series, you can add parameters in there, you can do return statements, all that stuff. So simple to do a console log. Yeah. This is epically static.

And now we'll replace that with static fine. And I run it. As you can see, this is epically static. And that's what a static function is. It does not require an object to be created. So if I literally delete all these lines of code, reload, as you can see still works.

Or bigger class, we haven't created an instance of it in the form of an object, it's going up into this. But we're starting to access it. So if let's say you have some functionality that's linked with what your class is, but you want it to be accessible, you know, anywhere really without having to create an audience. git commit, this is the way to go, you use a static function. Thanks for watching. If you have any questions, feel free to pop me a message and I'll lend your hand and as usual, I look forward to seeing you in the next static video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.