Object-oriented programming is a paradigm based on encapsulating logic and data into objects, which may then contain fields and procedures. Many of the most widely used programming languages are based on OOP, making it a very important concept in modern programming.
Many programming languages implement a type system. A type system is a set of constraints that a given variable must obey in order to be considered a predefined type. The main purpose of a type system is to reduce the likelihood of bugs in a computer program. All good developers should be able to work with types.
Public questions (free account) are common interview questions. They are great for practicing, or if you want to filter candidates using the classic problems.
The following code initializes strings as three different types and attempts to make them uppercase. Which statements about the behavior of the typescript compiler are correct?
let stringType: string = "string type"; stringType.toUpperCase(); let anyType: any = "any type"; anyType.toUpper(); anyType.toUpperCase(); let objectType: Object = "object type"; objectType.toUpperCase();
(multiple correct answers possible)