Counter Example 001

Developer
Size
2,283 Kb
Views
6,072

How do I make an counter example 001?

What is a counter example 001? How do you make a counter example 001? This script and codes were developed by JasonPark on 19 December 2022, Monday.

Counter Example 001 Previews

Counter Example 001 - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Counter Example 001</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="counter"></div>
<button>+</button>
<button>-</button> <script src='https://wzrd.in/standalone/expect@latest'></script> <script src="js/index.js"></script>
</body>
</html>

Counter Example 001 - Script Codes CSS Codes

#counter { display:block; width:200px; height:30px; background-color:#eee; text-align:center;
}
button { width:96px;
}

Counter Example 001 - Script Codes JS Codes

"use strict";
var counter = function counter() { var state = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; var action = arguments[1]; switch (action.type) { case "INCREMENT": return state + 1; case "DECREMENT": return state - 1; default: return state; }
};
// ACTIONS : inc, dec
var actions = { INC: { type: "INCREMENT" }, DEC: { type: "DECREMENT" }
};
// TEST
expect(counter(0, actions.INC)).toEqual(1);
expect(counter(1, actions.DEC)).toEqual(0);
// expect(
// counter(2, DECREMENT)
// ).toEqual(0); 에러가 남!
Counter Example 001 - Script Codes
Counter Example 001 - Script Codes
Home Page Home
Developer JasonPark
Username wooljs
Uploaded December 19, 2022
Rating 3
Size 2,283 Kb
Views 6,072
Do you need developer help for Counter Example 001?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

JasonPark (wooljs) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!