Skip to content

Instantly share code, notes, and snippets.

@oleersoy
Created August 14, 2018 02:01
Show Gist options
  • Save oleersoy/73c00f3a2bba3706bfba36b777b0373c to your computer and use it in GitHub Desktop.
Save oleersoy/73c00f3a2bba3706bfba36b777b0373c to your computer and use it in GitHub Desktop.
Example of completing a Todo with
interface Todo {
id:string;
title:string;
complete?:boolean;
}
let completed: boolean = true;
let todo:Todo = {title: "Do the Dew", id:"1"};
let completedTodo = {...todo, completed}
console.log(completedTodo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment