# CodeHSConsole

#### new CodeHSConsole()

Set up an instance of the console library.

Source:
  - console/console.js, line 34

### Methods

#### (static) clear()

Clear the console's text.

Source:
  - console/console.js, line 139

#### (static) exists()

Check if the console exists. Important to check before attempting to select and extract output.

Source:
  - console/console.js, line 132

#### (static) getNamespaceModifcationString() → {string}

Generate strings for the public methods to bring them to the public namespace without having to call them with the console instance.

Source:
  - console/console.js, line 51

##### Returns:

Line broken function definitions.

Type
  string

#### (static) getOutput() → {string}

Get the output from the console.

Source:
  - console/console.js, line 124

##### Returns:

Type
  string

#### (static) registerPublicMethod(name)

Adds a method to the public methods constant.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | Name of the method.

Source:
  - console/console.js, line 42

#### (static) setSolution(soln)

Set the solution code for a given exercise.

##### Parameters:

Name | Type | Description
--- | --- | ---
`soln` | string | Solution code.

Source:
  - console/console.js, line 73

#### checkOutput()

Check the console output for correctness against solution code. returns {object} Dictionary containing boolean of success and message.

Source:
  - console/console.js, line 81

#### print(ln)

Print a line to the console.

##### Parameters:

Name | Type | Description
--- | --- | ---
`ln` | string | The string to print.

Source:
  - console/console.js, line 193

#### println(ln)

Print a line to the console.

##### Parameters:

Name | Type | Description
--- | --- | ---
`ln` | string | The string to print.

Source:
  - console/console.js, line 215

#### readBoolean(str) → {str}

Read a bool from the user.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | str | A message associated with the modal asking for input.

Source:
  - console/console.js, line 283

##### Returns:

The result of the readBoolean prompt.

Type
  str

#### readLine(str) → {str}

Read a line from the user.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | str | A message associated with the modal asking for input.

Source:
  - console/console.js, line 269

##### Returns:

The result of the readLine prompt.

Type
  str

#### readLinePrivate(str, looping)

Private method used to read a line.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | The line to be read.
`looping` | boolean | Unsure. This is a messy method.

Source:
  - console/console.js, line 150

#### runCode(code)

This is how you run the code, but get access to the state of the console library. The current instance becomes accessible in the code.

##### Parameters:

Name | Type | Description
--- | --- | ---
`code` | string | The code from the editor.

Source:
  - console/console.js, line 173