top of page

 Now if you're ever wondering if you can call a method on to say a string or any given object or an array, for example, there's actually a need to do that and it's kind of built into the chrome developer tools. So if you open up the dev tools you can get there by just kidding inspects I hit command option. I mean mac brings me to the console here. And normally if you're working on javascript and you have it open in your browser you can just go to the top level and access any globally declared variables. First off the bat, for example, my string here it's a globally declared variable because of the nature of the way that Jaspan functions. You can just access or as I should say you can't just directly access it like so. You can, however, switch in a little drop down here learn java programming online by Digital Marketing companies in Delhi from top to Jaspan output and it's all access the runner here which gives us access to the internal javascript inside here where we've been coding and then you could say for example I want to see all the methods available on my string so we can see my string Daut and then the autocomplete kind of pops up here.

 

And these are all the methods that we can call on a string and it is a whole lot we can call in the string which is pretty cool. And if you change something here in the console it's not really going to affect your code in any way. So you know if we say my string got to lower case that's the method that we can all see what happens it shows us what it is in lowercase. What if we did my string to uppercase it we can definitely call that as well. And now we can check Digital Marketing Companies in Delhi out hey what is my string look like. It's pretty neat to be able to do that. We can check that is on the object. Well, my object is all of this kind of these are the internet marketing services that we define. Then we have all these other stuff we call on the object. It's just a tip for you if you are wanting to check that out at any time. You know put the top of the spec close.

 

Unfortunately, you can't do that in the built-in console. You could use the built-in the console for certain things. For example, you say my string to upper case if it does that for you. But it's not as nice in terms of the auto-completion type stuff. So that's just a handy tip that we can use so that you don't try to do something like call keys on something you don't have that method available on another method you can do to check whether something has the owns property or not. For an example of Digital Marketing Companies in Delhi, my OB chazzan own property of a and owned property of B and owned property of the value of you can actually just call his own property on it. So let's cancel some of that so we could say my AABs dog has own property and then you give it a string to look for the property you want to check if it has. So does my large have a property? A.

 

And this should return true because we know that we do have a property called a run and it is true here. You know let me stop cons. logging this stuff here so it does have own property. A. Does it have owned property be up? Does it have on properties see it? We know we don't have a key of C so this will return false. There we go. What about if we want to check Digital Marketing companies in Delhi. Does it have a property value of what is going to return to us? True. OK. So it definitely does. But what if we didn't have this right so we know that value of we can call it on the prototype of an object. So now if we check his own property it's false. So that's a quick way to check if the property is internal to your instance or not.

bottom of page