JE::Ob...Number(3pm)

πŸ“¦
version 0.066 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

JE::Object::Number β€” the JavaScript Number object class, bestie ✨

Like, it's the object wrapper version of a JS number. Not the plain primitive. We'll get to that. πŸŽ€


🌸 SYNOPSIS 🌸

use JE;
use JE::Object::Number;

$j = new JE;

$js_num_obj = new JE::Object::Number $j, 953.7;

$perl_scalar = $js_num_obj->value;

0 + $js_num_obj;  # 953.7

okay so you make a JE first, then you wrap a number in a JE::Object::Number, and then you can pull the Perl scalar back out with ->value β€” or just, like, do math on it and Perl goes "sure bestie" and it numifies to 953.7 πŸ’…


✨ DESCRIPTION ✨

This class implements JavaScript Number objects for JE. πŸ¦‹

Now the tea: what's the difference between this and JE::Number? Okay so JE::Number handles primitive number values β€” the raw little numbers, the ones that are just vibes and a value. This module handles the objects. Like, the actual Number objects, with the wrapper and the methods and the main character energy. πŸ‘‘

Two different things. Both valid. Don't mix them up. πŸ’€


πŸŽ€ METHODS πŸŽ€

Most of the methods? Already described over in JE::Types, go read that, it's giving comprehensive. πŸ“š

Only the stuff that's specific to JE::Object::Number gets explained here, because that's the whole point. ✨

value

Returns a Perl scalar containing the number that the object holds. πŸ“

That's it. That's the method. It gives you back your number. No cap.

class

Returns the string 'Number'. 🌈


πŸ”₯ SEE ALSO πŸ”₯

  • JE
  • JE::Types
  • JE::Object
  • JE::Number

perl v5.36.0 Β· 2023-08-25 β€” that's the version and the date this page was cooked up, mwah πŸ’‹ go forth and wrap your numbers in objects, bestie, you're gonna slay πŸ«Άβœ¨πŸ’–

πŸ“¦ where this page comes from