What you need to learn to become a mobile developer in 2018 - Final Part
Do Not declare types, they must rely on explicit, type definition, of whatever, variable, is receiving, them so up is declared, as a function, that gets a string and returns another string, that's exactly, what this is string inside, run brackets, in followed, by an arrow and string are doing, note that me anonymous function, above upper, could have been declared with the same thing between a column in the ecosphere we don't do that just to don't be redundant so, if it has also lambdas, in what the function type declarations, is exactly as in Cortland each string arrow string, but inside instead of another arrow, we used a statement in the, whole idea is absolutely. The same type, script has no lambdas, instead, there is a handy construct, called arrow functions, or to be more precise fat, arrow functions, it has an important, particularly if, you are curious that's regarding, the lexical, scope of the DS keyword but I'm not going to extend too much on that for now lambdas. With one single parameter encoding don't need to declare not even the parameter name just use it I T internally. The ideal Swift is extended, to more than one parameter as you can access, them through positional. Names with dollar sign in the number in this case dollar, zero nothing, on the useful type script finally, quarterly has human line of functions, removing, the curl is the very next expression after the e cosine would treated as the whole function, body and its result, will, be the function return' you, can achieve the same simplicity with, every function in typescript. Now. Let's the start with typescript please allow me to don't explain much on that otherwise, this video would take forever as I said my focus is to show the correspondences. In those languages, not necessarily. Explain the concepts, in typescript, class, attributes, are ordinary, variables, with no users of violet. Or cons keywords, really, only is used to turn variables, attributes, into, constant, ones methods, are like regular, function, but, also without function, P world constructors. Are functions, exactly, called, constructor. Instead of the same class name as Java programmers, would expect objects. Self-reference, is called, this so, this constructor, is assigning, it's an immediate arguments, named in number of sides to the objects internal State look. How similar it is in Cortland except, for the open class at the beginning as classes, in Courteney a final by default and also for the users of Val, and var to declare constant, in verbal, attributes all the rest is the same in, Swift constructors are called initializers. In the finally using the unit cube it used self instead of DS as, you can see all the rest is the same in, typescript, there is a short code for what was done above declaring. Parameters, we freed only public or private they, are automatically, convert, into objects, attributes no. Need for many assignments quadlin, has something, conceptually, similar although, not exactly the same way classes. Can have a primary constructor. Which is a declaration, at the class head with the only intent of declare, or initialized. Attributes, so, if it has all Venus initialized. But with a different idea I will take these for now, so. We have the front superclass, use the keyword extends, that's pretty common many other languages, to reference, elements, from the superclass use super, let's assume we have created, a method called simple desk in the superclass, this declaration, here will override, it for square instances, but it is still possible to assess, them internally, using super in so if there is a super command but instead of just super in parentheses, to call a parent's constructor, you have to call super, dot init to call their parents initializer.
Simple Desk will not only override, its parents counterpart, but they override key world will ensure that you won't accidentally, type anything in wrong and end up not overriding, that quatrain goes a bit crazy when it comes to classes, besides, primary, in secondary, constructor. It also has initialization. Blocks in it blocks don't, allow parameters, but can be handy to group attribute sensitization together Quadling, also requires the override keyword on the method and the method must be declared use an open keyword in the superclass otherwise, it would be treated as final, so no override, would be possible, finally. Let's create objects, in Cortlandt just call the class name as it was a function did you create your instance here, is where the finds name number, of sites inside, length and you can read those from, s at any time however, the, constant, in was, explicitly, declare, of the type named shape that's, why is known as polymorphic. Attribution. Although the object, is an instance of square, you cannot access n, dot, side length because, n is set as named shape at the very end as to receives, in but, as a square can you infer what's the type of s to in Swift, everything, is quite the same the, only exception, is the exclamation mark which, is a faucet, and rapid of optional, values in. Typescript, the absolute unique difference, front Kotlin is the operator, new to instantiate the object, well that lists the end of the video and also the end of the entire series, I hope you have enjoyed it I know that learning 3d languages, at the same pace can be absolutely mind-blowing, but I hope you have realised that they are not so different and if you decide to study concept, by concept featured. By featured in look how they are achieved, in all of these languages, you might save much time but if you are asking where you can find content, organizing, that so particular, disposition I'm happy to say that's exactly what I'm putting together at the moment I'll be launching some courses following, my mobile polyglot plan so stay tuned follow me on Twitter YouTube, LinkedIn, and. Also on udemy and I will let you know once it's live thanks a lot for company me for so long for this whole journey in see you soon.