 stabby functions and do blocks. So these are called stabby lambda functions or also just lambda functions and they're really quick and dirty ones and they're part of or they're an example at least of anonymous functions anonymous in that they don't really have a name so you can't really call them and we can extend the use by these do blocks which are also really a form of anonymous functions. What are stabby functions? Let's have a look. They use this minus and greater than sign hence the I suppose the stabby and anyway here we have X and then this stabby notation that's a minus and greater than sign 2x squared plus 6 minus 2. Now how do we use that? Well quite easy we use it with this map function. Let's run that block of code now let's use this map function so I'm saying map and then the map inbuilt function I'm passing an argument to it the first argument is this stabby function and I suppose we can read it as X such that X 2x squared plus 3x minus 2 and I'm passing it an array here 1 2 3 4 5 so it's going to iterate through all of these put it into X and calculate this little expression and there we go so 2 times 1 is 2 2 squared is 4 well it's going to do that so sorry 1 squared 1 squared is 1 2 times 1 is 2 plus 3 is 5 minus 2 is 3 and there we get the 3 but we can also write it slightly differently so I'm going to map again with our map function then the array and then do X and there is my little stabby function there just a different notation you can see that it's going to do exactly the same thing so you can do a little bit more let's map I've got three six nine ten eleven here do X and instead of just using my stabby function there I can use this do as a function all on its own and that I have an if else if else if else statement here so if mod X comma 3 so X means it's going to iterate through these three six nineteen eleven mod X with three that means divide three into X and what is the remainder so the remainder zero I want you to take whatever values next at the moment multiplied by 100 else if the mod is three so in other words services is 11 11 goes into three three times and what is left to is left so then we're going to do two and 200 times X and if it is three so again 11 divided by three that's three with the remainder of two if it finds that to be true it's going to execute that line of code so quite a simple do block do some do blocks there and once again it's a map function so it gets called and indeed we get the 300 because that's this remainder of dividing three into three is there's a zero remainder so that's going to multiply the three by a hundred and for instance this last one 11 times 300 is going to give me 3300 down there so stabby functions if you really just need to run I suppose to map very easy to map an array through a function and usually a mathematical function as we had here good so in the next section we're going to have a look at functions as arguments