Interview Questions and Answers - Order By Newest Q61. write an angular Typescript program to add item into an array TypeScript
This question was recently asked at 'Moneris'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q62. What are some downsides to static typing in TypeScript? TypeScript
This question was recently asked at 'Workday'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies This question was recently asked at 'Intelliware Development'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q64. what is strict mode in javascript ? How is it used ? Javascript
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q65. Have you ever used sessionStorage ? What is the better way to store session information - sessionStorage or session cookie ? Session Management
Ans. Session Cookie, because session storage can be accessed from XSS (Cross site Scripting) attacks but cookies (if set with "HttpOnly" and "Secure" flags) are more safer against these attacks. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  SessionStorage  session cookie  session management  javascript Q66. What are the benefits of using UI framework like Angular , View js etc instead of plain vanilla js and html ? Javascript
Ans. These frameworks facilitates easier product development and enhancement and maintainability by having separation of concerns ( using oops ) and helps in development of reusable libraries / components. So in nutshell , they make development and maintenance of large scale application easier. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Javascript Frameworks  Angular  View js Q67. How can print the whole object state in the console in javascript ? Javascript
Ans. We can JSON.stringify Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  javascript  angular Q68. How can you trim all strings in an array ?
Ans. array.map(s => s.trim()) Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   angular   typescript   javascript Q69. Is it safe to use session storage ? Javascript
Ans. Session storage can be accessed from XSS (Cross site Scripting) attacks but cookies (if set with "HttpOnly" and "Secure" flags) are more safer against these attacks. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  session storage  security Q70. Can we specify that a particular variable may have either of the two data types in Typescript ? Typescript
Ans. let result: string | boolean; Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q71. How can we specify that a particular variable may have either of the two data types in Typescript ? Typescript
Ans. Yes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q72. How can we specify that a particular variable may have either of the two data types in Typescript ? Typescript
Ans. let result: string | boolean; Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q73. What does the following declaration mean
let result: string | number; Typescript
Ans. It means we can assign either a string or a number to result. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q74. Will the following code give any error
let result: string | number;
result = true; Typescript
Ans. Yes, result can either be string or a number but not boolean. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q75. Will the following code give any error
let result: string | number;
result = 'true'; Typescript
Ans. No Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q76. Will the following code give any error
let result: string | number;
result = 'true'; Typescript
Ans. No Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q77. Will the following code give any error
let result: boolean;
result = false | true; Typescript
Ans. Yes, | is a bitwise operator and not boolean or. Use || instead Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q78. Will this code give any error ?
let result: boolean;
result = false || true; Typescript
Ans. No Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q79. Will this code give any error ?
let result: boolean | string;
result = false || 'true'; Typescript
Ans. No Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q80. Will this code give any error ?
let result: string;
result = false || 'true'; Typescript
Ans. No Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q81. What is Array.Map function ? What will be output of following ?
const myArray = [1, 4, 9, 16];
const result = myArray.map(x => x * 2); Javascript
Ans. It will create an array with each value as x*2
[2, 8, 18, 32] Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 2 Companies Q82. Which of the following file is called deployment descriptor ? Java EE
a. application.xml b. web.xml c. config.xml d. web-application.xmlAns.b. web.xml