[JS Tutorials] Global Functions in JavaScript | JavaScript Tutorial | Mr. Subba Raju [w/ subs]



00:00:02 – [Music]
00:00:09 – is this is a borracho in this video
00:00:11 – session we can view JavaScript the
00:00:14 – global functions generally functions
00:00:16 – concept already i did in the previous
00:00:18 – video session now global functions what
00:00:22 – is the meaning of global functions first
00:00:25 – of all in JavaScript or at any
00:00:28 – programming language function means code
00:00:32 – reusability means one set of or one
00:00:37 – block of lines if you want to use
00:00:39 – repeatedly n number of times you are
00:00:43 – using function with that name we are
00:00:45 – calling global function means what the
00:00:49 – all these are predefined functions in
00:00:52 – JavaScript we can use at any level at a
00:00:58 – section level or a body section level or
00:01:01 – external javascript level we can use
00:01:04 – first function evil evaluates it is
00:01:09 – always evaluating numerical values for
00:01:14 – example evil function evaluates or
00:01:17 – execution arguments it now expression
00:01:21 – they provided here let me write one
00:01:23 – small example doctype header section
00:01:28 – text or javascript javascript closed now
00:01:39 – inside I am writing here ver1 variable X
00:01:43 – is equal to prompt prompt amines reading
00:01:47 – the values enter any number or numbers
00:01:52 – noise close that default value am giving
00:01:57 – five just fine now eval alert you can
00:02:02 – alert evil of X alert just I said
00:02:09 – successfully calculated successfully
00:02:14 – computed let me run this evil refresh
00:02:20 – another browser
00:02:22 – sking me this page says enter any number
00:02:25 – or numbers or the default value 5-9 plus
00:02:29 – 7 multiplication 16 okay 108 okay and
00:02:35 – successfully computed very good so
00:02:40 – evaluate numerical values if you are
00:02:45 – giving non numerical value and it is
00:02:48 – getting failure that is how to recover
00:02:50 – in the previous video session try-catch
00:02:53 – finally I shown very clearly now next
00:02:57 – global function i am going to the next
00:02:59 – one is called is a finite very simple
00:03:03 – all numbers are finite all non numbers
00:03:08 – are infinite if it is a number it
00:03:11 – returns to if it is a non number it
00:03:14 – returns false see now they the ease
00:03:18 – finite is used to determine whether a
00:03:21 – specified number is finite or not is a
00:03:25 – fine it is a top-level function not
00:03:27 – associated with any object global
00:03:29 – function not associated with any object
00:03:32 – it is a common for all right is a finite
00:03:35 – number simply I am writing one small
00:03:39 – document dot write to make you people
00:03:43 – more clear document dot write simple I
00:03:48 – said here is fine it is finite I said
00:03:56 – 105 that's all now you can see that is
00:04:01 – fine it answer what written to written
00:04:05 – why means all numbers what I said fine
00:04:09 – it now come back now for example I am
00:04:13 – taking this cut it right simpler user
00:04:19 – break actually this is not correct
00:04:20 – process i will use inside that okay now
00:04:25 – i am giving save it next level i am
00:04:28 – using is fine it is fine it I said
00:04:33 – simply n
00:04:35 – 80 nourish IT okay good close it command
00:04:40 – refresh on the web browser perfect
00:04:42 – because string is infinite so next
00:04:48 – global function available is a man just
00:04:52 – to ease the finite opposite is a man
00:04:55 – string means true number means false
00:05:00 – previously number means true string
00:05:04 – means false now ease in a definition
00:05:07 – also we can see come with me is finite
00:05:10 – after is not even and function is used
00:05:13 – to determine whether a value is not a
00:05:16 – number or not it is also global so E is
00:05:20 – an aunt x value come back in the
00:05:22 – previous area only we can test it is not
00:05:26 – a number n a n and I am giving 105 like
00:05:32 – that all I am not changing the values
00:05:34 – and even concatenation also same like
00:05:36 – that man so what you are expecting same
00:05:39 – previous result proof walls now falls
00:05:41 – true so these are the global functions
00:05:45 – we'll see another global function what
00:05:47 – is that parse into parsefloat what is
00:05:51 – the meaning of parse int parsing means
00:05:54 – conversion convert to in teaser
00:05:56 – parsefloat means pass conversion
00:05:59 – floating values now parsing the paths of
00:06:02 – root level one is converting a number
00:06:05 – another one is converting into floating
00:06:08 – value first we can see parse int area so
00:06:10 – definition available integer pass in
00:06:12 – string first i will show you example
00:06:15 – basic level now for example i am taking
00:06:18 – where x is equal to 500 what variable
00:06:23 – explicit variable i declare where y is
00:06:27 – equal to 400 again another explicit
00:06:31 – variable where z is equal to x + y now i
00:06:36 – am writing document or dot write sum of
00:06:41 – two numbers is two numbers is + j
00:06:48 – now i am going to refresh that come on
00:06:52 – refresh on the screen perfect answer
00:06:55 – already by default numerical values
00:06:58 – existed same number place number is
00:07:00 – equal to number for example 500
00:07:03 – fortunately available like this but now
00:07:07 – you will get unfortunate answer
00:07:09 – meaningless it is con coordinating
00:07:12 – simple thing can coordinating means
00:07:14 – adding string values always added con
00:07:17 – coordinated right now for example the
00:07:21 – inductor situation we are going to use
00:07:23 – parse int of X this string value
00:07:29 – converted into in teaser now it is
00:07:32 – returning the perfect answer for example
00:07:37 – we are going to that area now i am
00:07:40 – writing nit and it is a string is it
00:07:42 – string can be passed not possible then
00:07:45 – it is giving an answer not a number
00:07:48 – string unable to convert into in t0
00:07:52 – value then javascript interpreter is
00:07:55 – given to you sorry boss it is not a
00:07:57 – number which one answer now you are
00:08:01 – coming to hear and you said 100 value
00:08:04 – and you said here again double quotation
00:08:08 – and again we need to use here what bars
00:08:11 – in of y yes you are expecting correct
00:08:16 – answer now once a 500 that is existed
00:08:19 – perfectly now for example i am removing
00:08:23 – now parsing ok i am removing percent ok
00:08:28 – if i am running this you know answer
00:08:31 – already now i'm saying minus perfect
00:08:35 – down sir you are getting what you know
00:08:36 – that yes minus 300 here only problem
00:08:41 – with plus because a plus acting as akin
00:08:45 – coordination operator + acting as a
00:08:48 – numerical additional operator reminding
00:08:51 – all automatically operations time you
00:08:54 – doesn't require parse int or parsefloat
00:08:58 – let me show another example here for
00:09:02 – example I am giving one kind of product
00:09:05 – the values so now 10 I am giving simply
00:09:09 – for right perfectly working whenever you
00:09:14 – are using plus again same previously
00:09:18 – whatever explain yeah 104 k actually
00:09:22 – what that 110 plus 4 is equal to 14 is
00:09:25 – 10 for displaying because + operators
00:09:28 – information c plus here change that
00:09:31 – symbol for example product perfectly
00:09:33 – coming now so plus operator as I said it
00:09:37 – is acting as akin coordination place or
00:09:39 – the matical level addition now we can c
00:09:42 – parsefloat level same person to uses
00:09:45 – there is no big difference here floating
00:09:47 – values purpose generally we are using
00:09:49 – for example remove that now remove this
00:09:53 – one also now I am giving here 10.09 for
00:10:00 – point Z naught okay so meaningful I am
00:10:05 – providing 19 so here 81 I will provide I
00:10:10 – hope you understood what i am doing
00:10:11 – simple understanding x plus y sum of two
00:10:15 – numbers yes refresh of it now for
00:10:20 – example you are giving here for s 15.3
00:10:26 – if you are putting this one in the
00:10:28 – quotation mark it is treating as a
00:10:30 – string then it is can coordinate it to
00:10:34 – avoid that we are using parsefloat same
00:10:38 – fast float level for example again you
00:10:41 – are keeping this one in the quotation
00:10:42 – again string well then we are giving
00:10:46 – parse parsefloat yes perfect terms
00:10:50 – change one value and check it perfect
00:10:53 – now we can take through prompt prompt t
00:10:57 – is nothing but reading the values now
00:10:59 – write x is equal to prompt prompt enter
00:11:04 – any number by default value I am giving
00:11:09 – 100 now the same value same prompt I'm
00:11:14 – copy to
00:11:15 – values i am taking by default this one
00:11:18 – 200 enter any number now no person
00:11:22 – required for me directly and show you
00:11:24 – because i am taking the value from the
00:11:26 – user right now refresh this asking me
00:11:31 – any number already by d400 available I
00:11:33 – wondering my value ok again 200
00:11:36 – available I am NOT giving 202b stay
00:11:39 – there ok so by default prompt taking
00:11:44 – from the user string value so that time
00:11:48 – whenever you are using prompt compulsory
00:11:50 – you need to write parse parse int of X
00:11:55 – and parse int of Y now we can go to our
00:12:03 – execution level yes same five hundred
00:12:06 – two hundred say they're perfectly
00:12:09 – executed so whenever you are reading the
00:12:11 – values from the keyboard also take care
00:12:13 – you need to conversion purpose you need
00:12:15 – to use percent if you require integer
00:12:17 – output parsefloat if you require
00:12:19 – floating output early thank you for
00:12:22 – watching my videos for more videos
00:12:24 – please subscribe in youtube com /
00:12:28 – narration a channel
00:12:30 – [Music]


Video Url:
http://youtu.be/4J108RvkgyE

Comments

comments