Code

Code

Represents a SoloLearn code

Constructor

new Code()

Source:

Members

accessLevel :*

Source:
Unknown value
Type:
  • *

(nullable) avatarUrl :string

Source:
The link to the author's profile picture if they have one
Type:
  • string

(nullable) badge :string

Source:
The name of the author's badge if they have one
Type:
  • string

comments :number

Source:
The amount of comments this code has
Type:
  • number

createdDate :string

Source:
The date this code was created
Type:
  • string

cssCode :string

Source:
The CSS code if this is a web code, empty if not a web code
Type:
  • string

(nullable) description :string

Source:
Unknown value
Type:
  • string

hasAvatar :boolean

Source:
Whether or not the code's author has a profile picture
Type:
  • boolean

id :number

Source:
This code's ID
Type:
  • number

isPublic :boolean

Source:
Whether or not this code is public
Type:
  • boolean

isPublicBlocked :boolean

Source:
Unknown value
Type:
  • boolean

isVisible :boolean

Source:
Unknown value
Type:
  • boolean

jsCode :string

Source:
The JS code if this is a web code, empty if not a web code
Type:
  • string

language :string

Source:
The programming language this code was written in
Type:
  • string

level :number

Source:
The level of the author
Type:
  • number

modifiedDate :string

Source:
The last time this code was modified
Type:
  • string

name :string

Source:
The name of this code
Type:
  • string

publicID :string

Source:
The public ID of this code
Type:
  • string

sourceCode :string

Source:
The source code or HTML if this is a web code
Type:
  • string

type :string

Source:
Unknown value - Always "Native"?
Type:
  • string

userId :number

Source:
The author's user ID
Type:
  • number

userName :string

Source:
The author's username
Type:
  • string

viewCount :number

Source:
The amount of views this code has
Type:
  • number

vote :number

Source:
The logged in user's vote on this code
Type:
  • number

votes :number

Source:
The vote count of this code (upvotes - downvotes)
Type:
  • number

xp :number

Source:
The amount of XP the code's author has
Type:
  • number

Methods

(async) run(inputnullable) → {Promise.<CodeResult>}

Source:
Run the code with the specified input and get the output
Parameters:
Name Type Attributes Default Description
input string <nullable>
null All inputs, separated by newlines
Returns:
- The result
Type
Promise.<CodeResult>