Skip to content

Tag: javascript

Create flower of life with intersection formula in Javascript

Based on this question : Question, I tried to create a flower of life. So far I got the 7 first petals but to create the rest of the flower (19 petals) I’m stuck because I can’t figure out what I’m doing wrong. I’m not so good in Maths and don’t exactly understand how to proceed.…

Typescript custom type

If I have an interface in typescript like so How can I factor out my type for text with the pipes so I can use it multiple times as a type in my program? It seems like it should be simple but I’m not sure what the syntax is For clarity I would like to be able to use it

Convert a string to an object and call a function

I want to store an object as a string, and then convert ot back to an object and call a method of this object. Answer If JSON.parse and JSON.stringify would allow a copy of methods, your code would be insecure and would have risks of people running arbitrary code on your server/computer since normally JSON st…