object with methods, you can simply call a method from the object returned. (ok)

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<script src="http//code.jquery.com/jquery.js"></script>
		<title>Document</title>
	</head>
	<body>
		<script type="text/javascript">
			var obj = {
				first: function() {
					alert('first');
					return obj;
				},
				second: function() {
					alert('second');
					return obj;
				},
				third: function() {
					alert('third');
					return obj;
				}
			}
			obj.first().second().third();
		</script>
	</body>
</html>

Last updated

Navigation

Lionel

@Copyright 2023