Counter Example 001
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 - 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); 에러가 남!
Developer | JasonPark |
Username | wooljs |
Uploaded | December 19, 2022 |
Rating | 3 |
Size | 2,283 Kb |
Views | 6,072 |
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!
Name | Size |
Tic Tac Toe Game with React and Redux | 2,267 Kb |
Popup-modal | 2,308 Kb |
A Pen by JasonPark | 3,087 Kb |
Cs | 6,479 Kb |
Main-contents | 3,232 Kb |
Polar Coordinate - Archimedean spiral | 2,114 Kb |
Guidepopup | 3,747 Kb |
Search popup | 2,475 Kb |
Javascript Queue | 2,218 Kb |
Polar Coordinate - Rose shape | 2,113 Kb |
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!
Name | Username | Size |
Animate a paper plane along an SVG path, looking ahead | PotatoDie | 3,734 Kb |
Electric worm | Jeffibacache | 2,377 Kb |
CSS3 Snow Animation | NickyCDK | 1,695 Kb |
Side Sliding Menu CSS | EduardL | 4,388 Kb |
Heartbeat | Apetrov | 2,079 Kb |
Comment Jquery | SquishyAndroid | 2,421 Kb |
Velocity.js custom stagger | Tommiehansen | 4,805 Kb |
My Starter Kit For Codepen | Dkdesign | 2,012 Kb |
Mega Menu by Joni | Asakasinsky | 3,171 Kb |
Clock with full screen background | Owebboy | 2,415 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!