From 84c02299d7206a9f50c605957ef80aab644a5ed6 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 30 Apr 2021 14:01:01 +0100 Subject: [PATCH 1/3] Five times tables --- five.js | 17 +++++++++++++++++ test.js | 3 +++ 2 files changed, 20 insertions(+) diff --git a/five.js b/five.js index 90507e66..9b06ccd8 100755 --- a/five.js +++ b/five.js @@ -220,6 +220,23 @@ five.bucks = function() { return '$' + five() + '.00'; }; + five.five = function () { + var self = { + total: "55", + }; + + function five() { + self.total += "5"; + return self; + } + + self.five = five; + self.toString = function () { + return self.total + }; + return self; + }; + five.valueOf = five; if(typeof module !== 'undefined' && module.exports) { diff --git a/test.js b/test.js index 63ee6cc8..dda8cb0b 100755 --- a/test.js +++ b/test.js @@ -154,6 +154,9 @@ assert.equal(five - five, 0); assert.equal((five / five) * (five), five); assert.equal(120, five.factorial()); +assert.equal(five.five().toString(), "55", "Five and five makes fifty-five"); +assert.equal(five.five().five().toString(), "555", "Three fives makes five hundred and fifty-five"); + var fiveEmitter = five.emitter(); var emitterTested = false; From 0e012bb91b91047dbf558486e89fa4fe787e5c87 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 30 Apr 2021 14:03:08 +0100 Subject: [PATCH 2/3] Five fives makes 55555 --- README.md | 1 + test.js | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index addc66f6..80505c9a 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,7 @@ five.discography(); //['5ive', 'Invincible', 'Kingsize'] five.singles(); //['Slam Dunk (Da Funk)', 'When the Lights Go Out', 'Got the Feelin\'', 'Everybody Get Up', 'It\'s the Things You Do', 'Until the Time Is Through', 'If Ya Gettin\' Down', 'Keep On Movin\'', 'Don\'t Wanna Let You Go', 'We Will Rock You', 'Let\'s Dance', 'Closer to Me', 'Rock the Party', 'I Wish It Could Be Christmas Everyday'] five.famous(); // ['Julian', 'Dick', 'George', 'Anne', 'Timmy'] five.fiveFiveFive(); // 'Interstella 5555: The 5tory of the 5ecret 5tar 5ystem' +five().five().five().five().five().toString(); // '55555' ``` ##### Rotation diff --git a/test.js b/test.js index dda8cb0b..d80ab9ef 100755 --- a/test.js +++ b/test.js @@ -156,6 +156,7 @@ assert.equal(120, five.factorial()); assert.equal(five.five().toString(), "55", "Five and five makes fifty-five"); assert.equal(five.five().five().toString(), "555", "Three fives makes five hundred and fifty-five"); +assert.equal(five.five().five().five().toString(), "5555", "Four fives makes five thousand, five hundred and fifty-five"); var fiveEmitter = five.emitter(); var emitterTested = false; From 603a52fa92aa834ade8e72b4532c600787d11019 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 30 Apr 2021 14:03:52 +0100 Subject: [PATCH 3/3] type --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 80505c9a..c017e259 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ five.discography(); //['5ive', 'Invincible', 'Kingsize'] five.singles(); //['Slam Dunk (Da Funk)', 'When the Lights Go Out', 'Got the Feelin\'', 'Everybody Get Up', 'It\'s the Things You Do', 'Until the Time Is Through', 'If Ya Gettin\' Down', 'Keep On Movin\'', 'Don\'t Wanna Let You Go', 'We Will Rock You', 'Let\'s Dance', 'Closer to Me', 'Rock the Party', 'I Wish It Could Be Christmas Everyday'] five.famous(); // ['Julian', 'Dick', 'George', 'Anne', 'Timmy'] five.fiveFiveFive(); // 'Interstella 5555: The 5tory of the 5ecret 5tar 5ystem' -five().five().five().five().five().toString(); // '55555' +five.five().five().five().five().toString(); // '55555' ``` ##### Rotation