understood guys ! Okay !
So let us start today’s session, the first question is
Primitive includes string… number…Boolean… etc. etc…Not necessary, that these three only,
There are more but in our course we used these three to run the programs. so we can remember these 3, for example string,
You can elaborate them further. like
“It represents a series of characters and is written with quotes. A string can be represented using a single or a double quote “
Number holds all the decimal values. Boolean holds all the logical values like true or false.Boolean is mostly used for conditional testing. Boolean values can be true or false.
Then we have the non primitive type, in that we have object and array.
We will consider object and array as a data type because the object holds collection of data and array holds the ordered list. means single type data types but it holds ordered lists.
If you answer this question completely you will make a good impression because the interviewer will think you have a deep knowledge of the software as you have elaborated the simplest question. You should represent simple questions with elaboration.
Make sure to not go on and on and bore the interviewer. you should keep that in mind. you should build a habit to give answers to the point.
your answer always should be to the point but you must add a little description. It really matters how you speak. Not much, other wise interview time will extend, In limited words, you should explain what you are talking about, you have ample knowledge about that.
The right amount of words that doesn’t impact on the duration of the interview while reflecting your knowledge. This was our first question. It will be enough, if you will answer how many data types there are ? What are the data types, what are their uses ? and If you answer in a similar manner, that will be enough.
The second question is,
There is a slight possibility that a fresher can be asked this question but at an experienced level there are a lot more chances to be asked this question. I have answered this question in my interviews and I have asked this question while conducting interviews. Hoisting is a commonly asked question.
you can answer of hoisting this way,
The answer is,
After the hoisting, The next question is,
“difference between double equals to and triple equal to operators.
So what happens in double equals operators? and what happens in triple equals operators?
We are asked the difference. Like I had mentioned before they check the value and it uses the width type.
the answer of that is like this,
“both are comparison operators”
So the answer is both of them compare values but the difference is double equals only checks the value but triple equals compares both. triple equals check values as well as type.
here, only the value will be checked means two equal to two, or if it is written x is equal to two, then, it will check if X’s value is two or not.
When I write x=2 in quotes, then what it becomes ? two becomes a string. So I have to check if 2 is an integer and I also have to check if it is a string. The same example is given below,
var x is equal to two and var y is equal to 2
the first one being a number and the second one being a string. So, now If i write x equal to equal to y , So The double equals says it’s true, because it checks only value but the triple equal says it’s false, because here type is numeric and and here it is a string. So the difference is double equals only for value and triple equals value with type. This is a question asked at an experienced level.
okay we will move forward to the next question,
The next question is,
This question can be asked to experienced people, but it can also be asked to freshers.
This is a question that can be asked at both a fresher and experienced level.
Now, we will move ahead to the next question.
The next question is,
“What is scope?”
When we covered this topic, I mentioned that scope is a very important topic in variable declaration. So, This is also a question that can be asked at both a fresher and experienced level.
You can answer about scope like this,
The answer is,
It means if I have written a block, for example I have taken a function and I have started the function with curly braces and I closed it, the way I write the variable determines if it is accessible within the limits of a function or outside. If it is within the limits of function then the scope is locally accessible variable and if the variable is accessible throughout the program it is called globally accessible variable. The scope is now global.
So, here in second line,
“In general terms, the scope will let us know at a given part of code, what are the variables and functions that we can or can not access.”
That means which variable I can use and which variable I can not use. that defines with the help of scope.
we will move forward to our next question,
The next question is,
What is a dome ?
This is a very very very important question that will definitely be asked. If you appear for an interview on java script then, what is the DOM ? this question will be asked 100 percent.
you can answer like this,
“DOM stands for document object model.”
The answer is to start by always telling the full form.
“DOM is a programming language interface for HTML and XML documents.”
Whenever you write a program, in which hierarchy, in which structure your elements will be placed, is defined by DOM.
“when the browser tries to render a HTML document, it creates an object based on the HTML document called DOM”
It means DOM is the object that holds all the elements placed in the document. and in the browser.
When the program creates elements one by one the object is the DOM. What can we do with DOM? We can manipulate or change various elements inside the HTML document. That means we can manipulate or change various elements and we can play dynamically. These changes we can do with the help of DOM.
Now, let’s move forward to the next question.
The next question is,
“What is the difference between let and var ?”
Later to define scoping let was introduced. So var was already there and let was added later.
for var “it has a function scope”
Var has a function scope which means it can be used throughout and within a function.
“Let, it has a block scope.”
It means curly braces are opened and closed, after this variable introduced by let will not be used. That means curly braces open and curly braces closed. They will only be accessible within the braces. Out of the curly braces, variables initialized through let, won’t be used.
But var can be used to access it outside the curly braces also if it is globally defined. Else we use another globally defined variable throughout the program. We have learnt hoisting, Hoisting is only possible with variables defined with var.
“variable will be hoisted “
If I define the same thing with let, It is not possible with variables defined with let.
“hoisted but not initialized”
If you design a let variable you cannot perform hoisting. It is mandatory to use var. This is a mandatory question even for the experienced.
Now let’s move forward to the next question,
8th question…the question is,
What is a cookie ?
If it is a dynamic website then you have been obliged to keep details of users.
So, it can be asked, ``What is a cookie ?
So there is a 50-50 chance of being asked about this for both levels. It is not like that cookie’s will be asked but, we should prepare for that.
So, what is a cookie ?
We have learnt how to initialize cookies, how it works. how to delete cookie,
you can answer of this question like this,
“A cookie is a piece of data that is stored on your computer to be accessed by your browser.Cookies are saved as key or value pairs”
It means it is part of data that is stored in your data that is used in the browser. plus, It is only defined in key value pairs. If you mention key value pairs in your answer it will be considered as a very good response. How to initialise a cookie will be explained well with this term. You have to use the term key value pairs to talk about initialisation. For example,
document dot cookie equal to username equal to john
It means, here ..document dot cookies, that means , I’m initialising a cookie in which, the key is username and the value is John. So whenever I need to use a document like, I want to do a task that is related to user name, so at that time I want to use this information, I will do it with the help of the information stored in the cookie.
so, what is a cookie ?
it has a 50 -50 percent chance, it can be asked or it can not be asked.
let’s move forward to our next question,
The next question is,
How do you delete a cookie ?
If you are asked anything about cookies, the chances of being asked this question increase. The chances are more for this question. We have learnt all the ways to delete a cookie in the module. We have learnt each and every method to delete cookies in our modules. Okay ! In this module, you can learn everything regarding cookies in detail.
You can answer it like this.
“you can delete cookie by setting the expiry date as a passed date “
It means you can add a cookie expire date, here it is written expires, you just need a date that has been passed and your cookie will be deleted.
now here it is written,
“you don't need to to specify a cookie value in this case “
in the document dot cookie , here you can add the value or not there will not be a problem even if it is an empty cookie.
If you want to delete it, you will add the expired attribute to it and add a past date. Clear on how to delete it?
now let’s move forward to the last question,
Last question is,
“What are the events ? ”
If you are applying for website making or web design and are interviewed, events are important. In that interview, you can be asked ‘ what are the events “?
Because we use events to make the websites dynamic. and the interviewer asked you this question, If you answer this question it will indicate that you know how to make websites dynamic.
This is why event questions will be asked. You can answer the question like this.
“Events are things that happens to HTML elements”
It means what can be done with HTML elements is defined by events. For example we click elements and bring the cursor on element, press a key on element etc..etc..etc. All these things are called events.
“Some of the examples of events are,”
we have events such as,
“the web page finished loading”, the event for this is Onload.
“Input field was changed”, that means input’s value has been changed, its event is change/onchange.
“Button was clicked” Event for button was clicked is onclick. All these are different events. There are other events like onclick…onblur..on double click…on mouse enter…on mouse leave etc. etc.. etc.. You can mention these to elaborate the answer.
If you have any queries or comments, click the discussion button below the video and post there. This way, you will be able to connect to fellow learners and discuss the course. Also, Our Team will try to solve your query.
Share a personalized message with your friends.