Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

enum

enum UserResponse {
  No = 0,
  Yes = 1,
}

function respond(recipient: string, message: UserResponse): void {
  console.log(recipient, message); // "Princess Caroline",  1
}

respond("Princess Caroline", UserResponse.Yes);
Comment

enum

An enumeration is a set of symbolic names (members) bound to unique, constant values. Within an enumeration, the members can be compared by identity, and the enumeration itself can be iterated over.
Comment

PREVIOUS NEXT
Code Example
Python :: transpose matrix python 
Python :: what are while loops 
Python :: infinity range or infinity looping 
Python :: is enumerate python lazy 
Python :: how to console log in django heroku 
Python :: full body tracking module 
Python :: spotify recommendations 
Python :: transcript with timestamps in python 
Python :: python mark function as no return 
Python :: using pickle to create binary files 
Python :: django default template location 
Python :: Python - Comment convertir le texte en discours 
Python :: python - notification messages 
Python :: pyqt fixed window size 
Python :: Forth step - Creating new app 
Python :: sarah 
Python :: asyncio run in executor 
Python :: #finding the similarity among two sets and 1 if statement 
Python :: indexers in python 
Python :: Filter dataarray 
Python :: how to app object pyhthon 
Python :: why does async def not work python 
Python :: install first person controller python 
Python :: let in python 
Python :: Python logging comma to dot 
Python :: pycharm writing issue 
Python :: withdraw() opposite tjinter 
Python :: python in a nutshell 
Python :: root = tk.Tk() my_gui = App1(root) 
Python :: panda3d attach to bone 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =