WEBVTT 00:06.020 --> 00:10.250 In this video you're going to learn static methods in E6. 00:10.490 --> 00:18.500 So inside your class you can add a static method which will be attached to the class itself and not 00:18.530 --> 00:21.010 to the instances of the class. 00:21.260 --> 00:22.850 So to create a static method 00:27.840 --> 00:32.910 you just use the static keyword followed by the name of your method. 00:32.940 --> 00:34.960 So let's call it default. 00:35.020 --> 00:43.450 For example let's say that this method will just return a default instance of our class. 00:43.860 --> 00:47.100 So let's give it a few 00:50.590 --> 00:51.320 arguments. 00:51.400 --> 00:56.610 Apple and iPhone 6. 00:56.730 --> 00:57.780 All right. 00:57.980 --> 00:59.970 So this is a static method. 01:00.020 --> 01:00.920 Now if you 01:04.220 --> 01:08.690 look for this method inside an instance of the class. 01:08.780 --> 01:10.880 So for example my phone 6 01:19.100 --> 01:27.080 then you get undefined because the static method is not attached to the instance of the class. 01:27.380 --> 01:27.850 All right. 01:35.290 --> 01:35.970 If you try 01:40.680 --> 01:50.690 phone six dots the static method then you get the function expression all right. 01:50.690 --> 01:56.580 And if you call this it works and you get the defaults then. 01:56.830 --> 01:57.170 All right. 01:57.590 --> 02:01.870 So that's how static methods work in E6. 02:02.000 --> 02:08.540 Now you can think about some built in methods in JavaScript which behave in a similar way to static 02:08.540 --> 02:09.220 methods. 02:09.290 --> 02:16.460 They're probably not defined the same way as E6 static methods but you can think for example about the 02:16.490 --> 02:22.040 objects those creates method which is attached to the object cos 02:26.350 --> 02:33.590 all right because if you want to use the Create method you have to use it with the object class or the 02:33.590 --> 02:34.970 objects objects. 02:34.970 --> 02:36.590 Now if you create an objects 02:40.180 --> 02:40.990 like this 02:47.010 --> 02:53.020 then you try to access the create method inside this objects. 02:53.030 --> 02:55.190 While this instance then it's not going to work. 02:55.190 --> 03:01.850 It gets undefined so static methods is a really interesting concept in iOS 6 which you would find in 03:01.850 --> 03:07.430 many other programming languages and it was missing in iOS 5.