From 6cc8ea22c76f037d5a1190359e6b2c5c1c86f6d4 Mon Sep 17 00:00:00 2001 From: Dheeraj Kumar <55842638+Dheeraj12121@users.noreply.github.com> Date: Sat, 11 Mar 2023 17:37:46 +0530 Subject: [PATCH 1/2] Add some typeScript interview questions --- src/json/interviewquestions.json | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/json/interviewquestions.json b/src/json/interviewquestions.json index a8b4238..251efeb 100644 --- a/src/json/interviewquestions.json +++ b/src/json/interviewquestions.json @@ -469,5 +469,31 @@ "question": "What is Fragment in React?", "answer": "React Fragment is a component that allows returning multiple children elements from a component without adding an additional node to the DOM hierarchy.", "tag": "react" + }, + { + "question":"What is TypeScript?", + "answer":"TypeScript is a statically-typed superset of JavaScript that adds optional type annotations and other language features to improve developer productivity and code quality.", + "tag":"typescript" + }, + { + "question":"How do you create variables in TypeScript?", + "answer":"In TypeScript, you create variables using the let, const, or var keywords, followed by the variable name, an optional type annotation using the : symbol, and an optional initial value using the = symbol. For example, let myVariable: string = 'Hello, world!''; creates a variable named myVariable with the type string and the initial value 'Hello, world!'", + "tag":"typescript" + }, + { + "question": "How do you set up TypeScript?", + "answer": "To set up TypeScript, you first need to install it globally or in your project using a package manager like npm. Then, you can create a TypeScript configuration file named tsconfig.json in your project root directory to specify compiler options and file locations. Finally, you can use a TypeScript compiler like tsc or a build tool like Webpack to compile TypeScript code into JavaScript.", + "tag": "typescript" + }, + { + "question":"What are some things to consider when choosing between TypeScript and JavaScript?", + "answer": "When choosing between TypeScript and JavaScript, you should consider factors such as the size and complexity of your project, the need for type checking and other language features, and the experience and preferences of your development team. TypeScript can provide better scalability, maintainability, and developer productivity for larger and more complex projects, but may have a steeper learning curve and require additional tooling compared to JavaScript.", + "tag": "typescript" + }, + { + "question": "Can you list and describe some primitive types in TypeScript?", + "answer" : "Some primitive types in TypeScript include number, string, boolean, null, and undefined. number represents numeric values, string represents text values, boolean represents true/false values, null represents absence of value, and undefined represents an uninitialized value or absence of value.", + "tag":"typescript" } + ] From 2b8c776e9c05b7020e42511eb49f9503a36fab99 Mon Sep 17 00:00:00 2001 From: DevvSakib Date: Sat, 11 Mar 2023 22:31:31 +0600 Subject: [PATCH 2/2] added missing bracket --- src/json/interviewquestions.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/json/interviewquestions.json b/src/json/interviewquestions.json index 89a3803..a2c6e61 100644 --- a/src/json/interviewquestions.json +++ b/src/json/interviewquestions.json @@ -494,7 +494,8 @@ "question": "Can you list and describe some primitive types in TypeScript?", "answer" : "Some primitive types in TypeScript include number, string, boolean, null, and undefined. number represents numeric values, string represents text values, boolean represents true/false values, null represents absence of value, and undefined represents an uninitialized value or absence of value.", "tag":"typescript" -}, + }, + { "question": "What happens if we leave useeffect dependency array empty?", "answer": "The empty array indicates that the useEffect doesn't have any dependencies on any state variables. Therefore, the callback function is only called once the page renders in this case.", "tag": "react"