TypeScript Array Object.values() Method Last Updated : 12 Jul, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report Object.values() is a functionality in TypeScript that returns an array extracting the values of an object. The order of elements is the same as they are in the object. It returns an array of an object's enumerable property values. Syntax:Object.values(object);Parameters:object: Here you have to pass the object whose values you want to extract.Return Value:An array that contains the property values of the given object which are enumerable and have string keys. NOTE: Since Object.values() is not directly available in TypeScript, we will implement it using the interface class. Example 1: Basic ImplementationThe below code example is the bais implementation of object.values() method in TypeScript. TypeScript interface Geek { name: string; workForce: number; } const geek: Geek = { name: "GeeksforGeeks", workForce: 200 }; const valArray: (number | string)[] = Object.values(geek) console.log(valArray); Output:["GeeksforGeeks", 200]Example 2: Implementation with Different Data TypesIn this example we defines an interface Car and two car objects car1 and car2. It then uses Object.values() to extract and log the values of these objects as arrays, showing their properties. JavaScript interface Car { carName: string; carNumber: string; model: number, sportsCar: boolean } const car1: Car = { carName: "Alto", carNumber: "AB05XXXX", model: 2023, sportsCar: false }; const car2: Car = { carName: "F1", carNumber: "AB05X0X0", model: 2024, sportsCar: true }; const carArr1 = Object.values(car1); const carArr2 = Object.values(car2); console.log(carArr1); console.log(carArr2); Output:["Alto", "AB05XXXX", 2023, false] ["F1", "AB05X0X0", 2024, true] Comment More infoAdvertise with us Next Article TypeScript Array entries() Method P pankajbind Follow Improve Article Tags : TypeScript Similar Reads TypeScript Array Object.entries() Method The Object.entries() method in TypeScript is used for creating an array of key-value pairs from an object's keys and values. This method simplifies the process of iterating over an object's properties and enables easier data manipulation.SyntaxObject.entries(obj);Parameterobj: It takes the object as 3 min read TypeScript Array entries() Method The Array.prototype.entries() method in TypeScript returns a new array iterator object that contains the key/value pairs for each index in the array. This method is useful when you need to iterate over the key/value pairs in the array.Note: In TypeScript, the entries() method is not available direct 2 min read TypeScript Object The Array Type In TypeScript, the Array Type is used to specify and enforce the type of elements that can be stored in an array, enhancing type safety during development. This adaptability ensures reusability across diverse data types, as exemplified by the Array type (e.g., number[] or string[]). Syntaxlet myArra 2 min read TypeScript Arrays An array is a user-defined data type. An array is a homogeneous collection of similar types of elements that have a contiguous memory location and which can store multiple values of different data types.An array is a type of data structure that stores the elements of a similar data type and consider 5 min read JavaTuple toArray() method The toArray() method in org.javatuples is used to convert the values in TupleClass into an array of Object type. This method is inherited from the JavaTuple class. This method can be used to any tuple class object of javatuples library. It returns an array of Object type formed with the values in th 2 min read JavaScript TypedArray.prototype.values() Method TypedArray's values() method returns a new iterator object for the array, this iterator will allow you to traverse through typed arrays and generate the value of each element at every position and like values() method for normal JavaScript arrays, it serves a similar role. SyntaxtypedArray.values()P 1 min read Like