Javascript/Typescript Flashcards
(39 cards)
What is the purpose of JavaScript?
JavaScript is a programming language used to create dynamic and interactive content on websites.
True or False: JavaScript is a statically typed language.
False
Fill in the blank: In JavaScript, a variable declared with ‘let’ is _____ scoped.
block
What is the output of ‘typeof null’ in JavaScript?
‘object’
What does the ‘=== operator’ do in JavaScript?
It checks for both value and type equality.
Which of the following is a JavaScript framework? A) Angular B) HTML C) CSS
A) Angular
What is a closure in JavaScript?
A closure is a function that retains access to its lexical scope, even when the function is executed outside that scope.
Define TypeScript.
TypeScript is a superset of JavaScript that adds static types and type checking.
True or False: TypeScript can help catch errors at compile time.
True
What is the file extension for TypeScript files?
.ts
What is an interface in TypeScript?
An interface is a syntactical contract that defines the structure of an object.
Fill in the blank: TypeScript supports _____ programming.
object-oriented
What is the purpose of the ‘tsconfig.json’ file?
It specifies the compiler options and the files to be included in a TypeScript project.
What is React Native?
React Native is a framework for building native mobile applications using React.
True or False: React Native applications are written in JavaScript and rendered as native components.
True
Which command is used to create a new React Native project?
npx react-native init ProjectName
What is the main purpose of the ‘render’ method in React?
The ‘render’ method is used to describe what the UI should look like.
Fill in the blank: In React, _____ is used to manage the component state.
useState
What are props in React?
Props are inputs to a React component that allow data to be passed from parent to child components.
What does ‘JSX’ stand for?
JavaScript XML
What is the purpose of the ‘key’ prop in React lists?
The ‘key’ prop helps React identify which items have changed, are added, or are removed.
What does the term ‘virtual DOM’ refer to in React?
The virtual DOM is a lightweight copy of the actual DOM that React uses to optimize rendering.
What is the difference between state and props in React?
State is managed within the component, while props are passed down from parent components.
True or False: TypeScript allows for optional parameters in functions.
True