Chaining results return undefined
See original GitHub issueOkay, I’m at a loss here. All the inputs are behaving correctly but my results
keep returning undefined
. Any thoughts? Using latest SWAL version and jQuery 3.1.0
my code:
$(".createacctbtn").click(function(){
swal.setDefaults({
confirmButtonText: 'Next →',
reverseButtons: true,
showCancelButton: true,
animation: false,
progressSteps: ['1', '2', '3']
})
var steps = [
{
text: 'Enter your name',
input:'text'
},
{
text:'Enter your desired password',
input: 'password'
},
{
text: 'Enter your email address',
input: 'email'
}
]
swal.queue(steps).then(function(result) {
swal.resetDefaults()
swal({
title: 'All done!',
html:
'Your answers: <pre>' +
JSON.stringify(result) +
'</pre>',
confirmButtonText: 'Lovely!',
showCancelButton: false
})
}, function() {
swal.resetDefaults()
})
});
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Optional Chaining in JavaScript returns undefined instead of ...
An optional chain does not evaluate to the nullish value on which the property was accessed, but to undefined - just like you...
Read more >Optional chaining (?.) - JavaScript - MDN Web Docs - Mozilla
When used with function calls, it returns undefined if the given function does not exist. This results in shorter and simpler expressions when ......
Read more >How to Use Optional Chaining in JavaScript - freeCodeCamp
The optional chaining operator ?. takes the reference to its left and checks if it is undefined or null. If the reference is...
Read more >Using and chaining promises in AngularJS - AirPair
Be aware that not explicty returning a value means that you have returned undefined , and the derived promise will be resolved with...
Read more >Optional chaining (?.) - JavaScript
When used with function calls, it returns undefined if the given function does not exist. This results in shorter and simpler expressions when...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
update swal2 to the latest.
Just downloaded directly from GitHub and added it to my page via
<script src="./js/sweetalert2.min.js" type="text/javascript"></script>
then dumped cache and hard reloaded in Chrome. (online app in development)