obj?.fn()
calls fn
member function if the object isn’t null, otherwise doesn’t do anything.
obj!.fn()
on the other hand asserts that obj
isn’t null, and calls fn
. If the object is null, you get an exception.
So it’s a difference in assertiveness: you either ask or simply claim the nullable property of a nullable object.
Related Posts:
- Declaration is only valid at file scope (extension)
- Swift protocols: method does not override any method from its superclass
- When is K 1024 and when is it 1000?
- Dial pad to get phone number (with Android button images)
- Why is it not possible to fake an IP address?
- Visual List of iOS Fonts?
- How to get rid of the “No bootable medium found!” error in Virtual Box? [closed]
- ‘git’ is not recognized as an internal or external command
- what is svn? and how to use it with project?
- How can I write a `try`/`except` block that catches all exceptions?
- How do I decompile a .dll file?
- What’s the purpose of git-mv?
- How to write trycatch in R
- how to use proxy on youtube-dl?
- SSH -X “Warning: untrusted X11 forwarding setup failed: xauth key data not generated”
- LINQ equivalent of foreach for IEnumerable
- Swift 4 Attempt to present ViewController whose view is not in the window hierarchy
- How to do vlookup and fill down (like in Excel) in R?
- Using “super” in C++
- What is the difference between application server and web server?
- Were jprobes removed from kernel v4?
- ldap_sasl_bind(SIMPLE): Can’t contact LDAP server(-1)
- PHP – Failed to open stream : No such file or directory
- How to extract the substring between two markers?
- Code-first vs Model/Database-first
- How to resolve git’s “not something we can merge” error
- Even though JRE 8 is installed on my MAC -” No Java Runtime present,requesting to install ” gets displayed in terminal
- What fonts can I use with pygame.font.Font?
- How to squash all git commits into one?
- how to fix Javac invalid flag error?
- PHP & MySQL: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given
- “Insert if not exists” statement in SQLite
- Web API Error – This request has been blocked; the content must be served over HTTPS
- How can I delete all of my Git stashes at once?
- How to create temp table using Create statement in SQL Server?
- Error while trying to retrieve text for error ORA-01019
- What is meant by diameter of a network?
- What is the “N+1 selects problem” in ORM (Object-Relational Mapping)?
- HTML Best Practices: Should I use ’ or the special keyboard shortcut?
- mount.nfs: requested NFS version or transport protocol is not supported
- How do you get the file size in C#?
- what does Error “Thread 1:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)” mean?
- how to use svm in Weka Classsifier?
- MIPS ‘nor’ usage in code
- type any? has no subscript members
- How can I center
- into a div?
- Popup window in PHP?
- LaTeX table too wide. How to make it fit?
- R Markdown – changing font size and font type in html output
- git add only modified changes and ignore untracked files
- HTTP Error 404.3-Not Found in IIS 7.5
- What is the difference between procedural programming and functional programming?
- Multiplying a register value by a constant in MIPS?
- What’s the use of the staging area in Git?
- Getting DOM element value using pure JavaScript
- Instagram how to get my user id from username?
- Procedural and non-procedural query language difference
- COM object that has been separated from its underlying RCW cannot be used
- Differentiate between function overloading and function overriding
- How to print variable in sml?
- Why is the minidlna database not being refreshed?
- Representing EOF in C code?
- How to disable an Android button?
- How to set initial value and auto increment in MySQL?
- Chrome Broweser: csi.gstatic.com keeps loading
- How do you convert an entire directory with ffmpeg?
- How to create a global variable?
- What’s the difference between sx and σx in the statistics calculations on a TI-Nspire?
- How can an Admin access the Google Drive contents of all the users in a particular domain?
- PSEXEC, access denied errors
- How do you define a global function in C++?
- A _disk_id.pod file appears on a windows flash drive
- What standard do language codes of the form “zh-Hans” belong to?
- What is the proof of of (N–1) + (N–2) + (N–3) + … + 1= N*(N–1)/2
- Merge posts plugin? [closed]
- database collation differences
- Add Woocommerce product to cart with Contact Form 7 [closed]
- How to See Everything in get_option()?
- How can I prevent the WordPress Importer from munging double-newline paragraph breaks to a single newline?
- Slow WP Site, theme.php not caching? Up to 25 second load time! [closed]
- A Compare And Distinction Essay Define To Beat Writer’s Block
- 27 Outstanding Faculty Essay Examples
- The Way To Write An Essay Outline In Four Steps
- How to hide subfolder of static pages in WordPress using htaccess
- Javascript: Add anchor hashtag to URL, and reload
- To remove rendering of menus and header, plugin or theme?
- How to Unban an IP properly with Fail2Ban
- How to see stdout of ansible commands?
- Difference between KVM and QEMU
- Top level domain/domain suffix for private network?
- Are SSD drives as reliable as mechanical drives (2013)?
- The Joel Test for system administrator jobs
- How do I rename a task in Task Scheduled on Windows Server 2008 R2
- How do I get the history of “apt-get install” on Ubuntu?
- Why does x86 represent 32bit when x64 represents 64bit? [closed]
- How to reload screenrc without restarting screen?
- How do high traffic sites service more than 65535 TCP connections?
- Using variables in Apache config files to reduce duplication?
- How to unify package installation tasks in ansible?
- Private IP address in public DNS