Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const clients = [{id: 1, name: '100'}, {id: 2, name: '200'}];
- const findFirstClient = (arr: typeof clients) => {
- return arr[0];
- }
- const firstClient = findFirstClient(clients);
- firstClient.name = 'one';
- console.log(clients);
- const firstClientAlternative = clients[0];
- firstClientAlternative.name = 'two';
- console.log(clients);
Advertisement
Add Comment
Please, Sign In to add comment