<commit_before># Calc.js API Reference

The world's smallest JavaScript calculator library (probably).

***Your Task:***

You should include a block of JavaScript code showing how to use your library. Additionally you should provide a function reference for each function in the Calc library. The first one has been done for you so you have a good idea of how it should be formatted.

The functions you should implement and document are as follows:

- Calc(number)
- Calc.getVal()
- Calc.plus(number)
- Calc.minus(number)
- Calc.times(number)
- Calc.divide(number)
- Calc.clear()



## Usage

```
var c1 = Calc(2);
var c2 = Calc(10);

c1.add(6);

c2.minus(1);

c1.divide(2);


console.log(c1.getVal()) // Prints 4
console.log(c2.getVal()) // Prints 9
```

## API Functions



\# *Calc*(number)

> Constructs a Calc object with the current value set to `number`

\# *Calc*.**getVal**()
> Returns the current value stored by the calc instance.

\# *Calc*.**plus**(number)
> Sets the current value of the calc instance to the current value plus `number` and returns that calc instance.

\# *Calc*.**minus**(number)
> Sets the current value of the calc instance to the current value minus `number` and returns that calc instance.<commit_msg>added syntax highlighting<commit_after># Calc.js API Reference

The world's smallest JavaScript calculator library (probably).

***Your Task:***

You should include a block of JavaScript code showing how to use your library. Additionally you should provide a function reference for each function in the Calc library. The first one has been done for you so you have a good idea of how it should be formatted.

The functions you should implement and document are as follows:

- Calc(number)
- Calc.getVal()
- Calc.plus(number)
- Calc.minus(number)
- Calc.times(number)
- Calc.divide(number)
- Calc.clear()



## Usage

```javascript
var c1 = Calc(2);
var c2 = Calc(10);

c1.add(6);

c2.minus(1);

c1.divide(2);


console.log(c1.getVal()) // Prints 4
console.log(c2.getVal()) // Prints 9
```

## API Functions



\# *Calc*(number)

> Constructs a Calc object with the current value set to `number`

\# *Calc*.**getVal**()
> Returns the current value stored by the calc instance.

\# *Calc*.**plus**(number)
> Sets the current value of the calc instance to the current value plus `number` and returns that calc instance.

\# *Calc*.**minus**(number)
> Sets the current value of the calc instance to the current value minus `number` and returns that calc instance.
{'fraction_non_alphanumeric': 0.11618589743589744, 'fraction_numerical': 0.01201923076923077, 'mean_word_length': 4.148453608247423, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7559610', 'n_tokens_mistral': 804, 'n_tokens_neox': 756, 'n_words': 318}