# Unconvertable code component

**URL:** <https://discourse.psychopy.org/t/unconvertable-code-component/12588>\
**Category:** Online experiments\
**Created:** [April 20, 2020, 7:15pm UTC](https://discourse.psychopy.org/t/unconvertable-code-component/12588 "2020-04-20T19:15:04Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [April 29, 2020, 3:08am UTC](https://discourse.psychopy.org/t/unconvertable-code-component/12588/9 "2020-04-29T03:08:35Z")

</div>

JavaScript’s built in `Math` library doesn’t seem to have a `ones()` function. I suspect you’ve come across that function in the 3rd party `math.js` package:

> **[math.js | an extensive math library for JavaScript and Node.js](https://mathjs.org/)**
>
> Math.js is an extensive math library for JavaScript and Node.js. It features big numbers, complex numbers, matrices, units, and a flexible expression parser.

I don’t know enough about JavaScript to advise whether or how you could install that library and access its functions from your script, but this thread might be useful:

> [@How to use my own modules on pavlovia](https://discourse.psychopy.org/t/how-to-use-my-own-modules-on-pavlovia/7981):
>
> URL of experiment: [Cindy [PsychoPy]](https://pavlovia.org/run/xfang/exp7/html/) Description of the problem: I need some js modules including one called papaparse, I tried to put it in the html folder but that doesn’t seem available. Just started learning javascript this week. Pointers appreciated.

---

_[View the full topic](https://discourse.psychopy.org/t/unconvertable-code-component/12588)._
